private
spatial_gating_block
— function
spatial_gating_block(planes, npatches; mlp_ratio = 4.0, mlp_layer = gated_mlp_block,
norm_layer = LayerNorm, dropout = 0.0, drop_path_rate = 0.,
activation = gelu)
Creates a feedforward block based on the gMLP model architecture described in the paper. (reference)
Arguments
planes
: the number of planes in the blocknpatches
: the number of patches of the inputmlp_ratio
: ratio of the number of hidden channels in the channel mixing MLP to the number of planes in the blocknorm_layer
: the normalisation layer to usedropout
: the dropout rate to use in the MLP blocksdrop_path_rate
: Stochastic depth rateactivation
: the activation function to use in the MLP blocks