vis4d.op.layer.mlp¶
MLP Layers.
Classes
|
Fully connected ResNet Block consisting of two linear layers. |
|
MLP as used in Vision Transformer, MLP-Mixer and related networks. |
- class ResnetBlockFC(size_in, size_out=None, size_h=None)[source]¶
Fully connected ResNet Block consisting of two linear layers.
Fully connected ResNet Block consisting of two linear layers.
- Parameters:
size_in (
int
) – (int) input dimensionsize_out (
Optional
[int
]) – Optional(int) output dimension, if not specified same as inputsize_h (
Optional
[int
]) – Optional(int) hidden dimension, if not specfied same as min(in,out)
- class TransformerBlockMLP(in_features, hidden_features=None, out_features=None, act_layer=GELU(approximate='none'), bias=True, drop=0.0)[source]¶
MLP as used in Vision Transformer, MLP-Mixer and related networks.
Init MLP.
- Parameters:
in_features (int) – Number of input features.
hidden_features (int, optional) – Number of hidden features. Defaults to None.
out_features (int, optional) – Number of output features. Defaults to None.
act_layer (nn.Module, optional) – Activation layer. Defaults to nn.GELU.
bias (bool, optional) – If bias should be used. Defaults to True.
drop (float, optional) – Dropout probability. Defaults to 0.0.