pub struct Gaussian3dTrainer<AB: AutodiffBackend> {Show 16 fields
pub iteration: u64,
pub learning_rate_colors_sh: LearningRate,
pub learning_rate_opacities: LearningRate,
pub learning_rate_positions: LearningRate,
pub learning_rate_rotations: LearningRate,
pub learning_rate_scalings: LearningRate,
pub metric_optimization_coarse: MeanAbsoluteError,
pub metric_optimization_fine: MeanStructuralDissimilarity<AB, 3>,
pub optimizer_colors_sh: Adam<AB, 2>,
pub optimizer_opacities: Adam<AB, 2>,
pub optimizer_positions: Adam<AB, 2>,
pub optimizer_rotations: Adam<AB, 2>,
pub optimizer_scalings: Adam<AB, 2>,
pub options_renderer: Gaussian3dRenderOptions,
pub range_metric_optimization_fine: RangeOptions,
pub refiner: Refiner<AB::InnerBackend>,
}
Expand description
Trainer for 3DGS.
Fields§
§iteration: u64
Current iteration.
learning_rate_colors_sh: LearningRate
Current learning rate for colors SH.
learning_rate_opacities: LearningRate
Current learning rate for opacities.
learning_rate_positions: LearningRate
Current learning rate for positions.
learning_rate_rotations: LearningRate
Current learning rate for rotations.
learning_rate_scalings: LearningRate
Current learning rate for scalings.
metric_optimization_coarse: MeanAbsoluteError
Metric for optimization (coarse).
metric_optimization_fine: MeanStructuralDissimilarity<AB, 3>
Metric for optimization (fine).
optimizer_colors_sh: Adam<AB, 2>
Current optimizer for colors SH.
optimizer_opacities: Adam<AB, 2>
Current optimizer for opacities.
optimizer_positions: Adam<AB, 2>
Current optimizer for positions.
optimizer_rotations: Adam<AB, 2>
Current optimizer for rotations.
optimizer_scalings: Adam<AB, 2>
Current optimizer for scalings.
options_renderer: Gaussian3dRenderOptions
Current renderer options.
range_metric_optimization_fine: RangeOptions
Current refiner.
refiner: Refiner<AB::InnerBackend>
Current refiner.
Implementations§
source§impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
sourcepub fn refine(
&mut self,
scene: &mut Gaussian3dScene<AB>,
grads: &mut AB::Gradients,
output: Gaussian3dRenderOutputAutodiff<AB>,
) -> &mut Self
pub fn refine( &mut self, scene: &mut Gaussian3dScene<AB>, grads: &mut AB::Gradients, output: Gaussian3dRenderOutputAutodiff<AB>, ) -> &mut Self
Refine the 3DGS scene.
For each refinement iteration, do the following steps:
- Compute the mean of 2D position gradient norms (projection errors).
- Densify the scene:
- Clone the small points.
- Split the large points.
- Retain the visible points.
- Update the optimizer records.
source§impl<B: Backend> Gaussian3dTrainer<Autodiff<B>>
impl<B: Backend> Gaussian3dTrainer<Autodiff<B>>
source§impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
sourcepub fn get_loss_colors_rgb_2d(
&self,
value: Tensor<AB, 3>,
target: Tensor<AB, 3>,
) -> Tensor<AB, 1>
pub fn get_loss_colors_rgb_2d( &self, value: Tensor<AB, 3>, target: Tensor<AB, 3>, ) -> Tensor<AB, 1>
Get the loss for colors RGB (Rendered 2D Image).
sourcepub fn optimize(
&mut self,
scene: &mut Gaussian3dScene<AB>,
grads: &mut AB::Gradients,
) -> &mut Self
pub fn optimize( &mut self, scene: &mut Gaussian3dScene<AB>, grads: &mut AB::Gradients, ) -> &mut Self
Optimize the 3DGS scene.
source§impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>
sourcepub fn load_record(
&mut self,
record: Gaussian3dTrainerRecord<AB::InnerBackend>,
) -> &mut Self
pub fn load_record( &mut self, record: Gaussian3dTrainerRecord<AB::InnerBackend>, ) -> &mut Self
Load the record.
sourcepub fn into_record(self) -> Gaussian3dTrainerRecord<AB::InnerBackend>
pub fn into_record(self) -> Gaussian3dTrainerRecord<AB::InnerBackend>
Unload the record.
Trait Implementations§
source§impl<AB: Clone + AutodiffBackend> Clone for Gaussian3dTrainer<AB>where
AB::InnerBackend: Clone,
impl<AB: Clone + AutodiffBackend> Clone for Gaussian3dTrainer<AB>where
AB::InnerBackend: Clone,
source§fn clone(&self) -> Gaussian3dTrainer<AB>
fn clone(&self) -> Gaussian3dTrainer<AB>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<AB: Debug + AutodiffBackend> Debug for Gaussian3dTrainer<AB>where
AB::InnerBackend: Debug,
impl<AB: Debug + AutodiffBackend> Debug for Gaussian3dTrainer<AB>where
AB::InnerBackend: Debug,
source§impl<AB: AutodiffBackend> Default for Gaussian3dTrainer<AB>
impl<AB: AutodiffBackend> Default for Gaussian3dTrainer<AB>
Auto Trait Implementations§
impl<AB> !Freeze for Gaussian3dTrainer<AB>
impl<AB> !RefUnwindSafe for Gaussian3dTrainer<AB>
impl<AB> Send for Gaussian3dTrainer<AB>
impl<AB> !Sync for Gaussian3dTrainer<AB>
impl<AB> Unpin for Gaussian3dTrainer<AB>where
<<AB as AutodiffBackend>::InnerBackend as Backend>::FloatTensorPrimitive: Unpin,
<<AB as AutodiffBackend>::InnerBackend as Backend>::QuantizedTensorPrimitive: Unpin,
<AB as Backend>::FloatTensorPrimitive: Unpin,
<AB as Backend>::QuantizedTensorPrimitive: Unpin,
<AB as Backend>::Device: Unpin,
impl<AB> UnwindSafe for Gaussian3dTrainer<AB>where
<<AB as AutodiffBackend>::InnerBackend as Backend>::FloatTensorPrimitive: UnwindSafe,
<<AB as AutodiffBackend>::InnerBackend as Backend>::QuantizedTensorPrimitive: UnwindSafe,
<AB as Backend>::FloatTensorPrimitive: UnwindSafe,
<AB as Backend>::QuantizedTensorPrimitive: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more