multigeom.encoders.readout#
Readouts: the part of an encoder that is fitted to neural data. A readout maps the feature map of a backbone, [B, C, S, S], to one response per neuron, [B, N].
* `GaussianReadout`: each neuron looks at a Gaussian window of the feature map (the
readout of the paper's encoders);
* `LinearReadout`: average the feature map over space, then one linear map (the simplest
baseline);
* `FactorizedReadout`: each neuron has its own learned spatial window and its own
feature weights.
All three take `(n_neurons, n_channels, spatial, dropout)` and are registered by name
("gaussian", "linear", "factorized"), so `NeuralEncoder(backbone, n_neurons,
readout="linear")` builds one and a saved encoder can be reloaded. Register your own
with `register_readout`.
Classes
|
Spatial window times feature weights, both learned (Klindt et al., 2017): |
|
Per-neuron Gaussian spatial-attention readout (Eq. |
|
Global average pooling over space, then a linear map from the channels to the neurons: |