gausplat_trainer::train::gaussian_3d

Struct Gaussian3dTrainer

source
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>

source

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:

  1. Compute the mean of 2D position gradient norms (projection errors).
  2. Densify the scene:
  • Clone the small points.
  • Split the large points.
  • Retain the visible points.
  1. Update the optimizer records.
source§

impl<B: Backend> Gaussian3dTrainer<Autodiff<B>>

source

pub fn train( &mut self, scene: &mut Gaussian3dScene<Autodiff<B>>, camera: &Camera, ) -> Result<&mut Self, Error>

Train the 3DGS scene.

source§

impl<AB: AutodiffBackend> Gaussian3dTrainer<AB>

source

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).

source

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>

source

pub fn to_device(self, device: &AB::Device) -> Self

Transfer the trainer to the device.

source

pub fn load_record( &mut self, record: Gaussian3dTrainerRecord<AB::InnerBackend>, ) -> &mut Self

Load the record.

source

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,

source§

fn clone(&self) -> Gaussian3dTrainer<AB>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<AB: Debug + AutodiffBackend> Debug for Gaussian3dTrainer<AB>
where AB::InnerBackend: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<AB: AutodiffBackend> Default for Gaussian3dTrainer<AB>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,