public
mlp_block
— function
mlp_block(inplanes::Integer, hidden_planes::Integer, outplanes::Integer = inplanes;
dropout = 0., activation = gelu)
Feedforward block used in many MLPMixer-like and vision-transformer models.
Arguments
inplanes
: Number of dimensions in the input.hidden_planes
: Number of dimensions in the intermediate layer.outplanes
: Number of dimensions in the output - by default it is the same asinplanes
.dropout
: Dropout rate.activation
: Activation function to use.