Multi Layer Perceptron

class nerfstudio.field_components.mlp.MLP(in_dim: int, num_layers: int, layer_width: int, out_dim: Optional[int] = None, skip_connections: Optional[Tuple[int]] = None, activation: Optional[Module] = ReLU(), out_activation: Optional[Module] = None)#

Bases: FieldComponent

Multilayer perceptron

  • in_dim – Input layer dimension

  • num_layers – Number of network layers

  • layer_width – Width of each MLP layer

  • out_dim – Output layer dimension. Uses layer_width if None.

  • activation – intermediate layer activation function.

  • out_activation – output activation function.

build_nn_modules() None#

Initialize multi-layer perceptron.

forward(in_tensor: Tensor) Tensor#

Process input with a multilayer perceptron.


in_tensor – Network input


MLP network output