Introduction

Tutorials

Developer guide

API Reference

private spatial_gating_blockfunction

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 block
  • npatches: the number of patches of the input
  • mlp_ratio: ratio of the number of hidden channels in the channel mixing MLP to the number of planes in the block
  • norm_layer: the normalisation layer to use
  • dropout: the dropout rate to use in the MLP blocks
  • drop_path_rate: Stochastic depth rate
  • activation: the activation function to use in the MLP blocks