MLPMixerBlockLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
A single MLP-Mixer block: temporal-axis MLP + channel-axis MLP, each wrapped with pre-norm and residual, per Tolstikhin et al. 2021 “MLP-Mixer: An all-MLP Architecture for Vision” (extended to time-series patches by Ekambaram et al. 2024 for Tiny Time Mixers).
Inheritance: LayerBase<T> → MLPMixerBlockLayer<T>
Implements: IShapeContract
How It Works
Operates on input tensors of shape [B, numPatches, hiddenDim]. The forward sequence is:
The temporal mixer mixes information across patches (time dimension); the channel
mixer mixes information across hidden features at each patch position. The transpose
is required so a plain DenseLayer (which operates on the last axis)
can be applied across the patch axis.
Constructors
| Constructor | Summary |
|---|---|
MLPMixerBlockLayer(int numPatches, int hiddenDim, int expansionFactor) |
Initializes a new MLPMixerBlockLayer. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ILayer<T>> GetSubLayers() |
|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
Derived from this type’s [TensorLayout] declarations. |
void ResetState() |
|
void UpdateParameters(T learningRate) |