nidn.training.utils package
Submodules
nidn.training.utils.abs_layer module
- class nidn.training.utils.abs_layer.AbsLayer
Bases:
ModuleVery simple activation layer to allow different abs layer activations of the siren.
- forward(input)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
nidn.training.utils.nerf module
- class nidn.training.utils.nerf.NERF(in_features, out_features, skip=[], n_neurons=100, activation=Sigmoid(), hidden_layers=8)
Bases:
ModuleNERF architecture as described by Mildenhall et al. (2020)
- forward(x)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class nidn.training.utils.nerf.NERFLayer(in_features, out_features, bias=True, activation=ReLU())
Bases:
ModuleLayer as used in NERF.
- forward(input)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- init_weights()
nidn.training.utils.siren module
- class nidn.training.utils.siren.SineLayer(in_features, out_features, bias=True, is_first=False, omega_0=30)
Bases:
ModuleSinuosidal layer for the SIREN model.
- forward(input)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- forward_with_intermediate(input)
- init_weights()
- class nidn.training.utils.siren.Siren(in_features, hidden_features, hidden_layers, out_features, outermost_linear=False, outermost_activation=AbsLayer(), first_omega_0=30, hidden_omega_0=30.0)
Bases:
ModuleSIREN model as described in the paper by Sitzmann et al. (2020).
- forward(coords)
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- forward_with_activations(coords, retain_grad=False)
Returns not only model output, but also intermediate activations. Only used for visualizing activations later!