multigeom.encoders.fitting#
Fitting the readout of an encoder to neural responses.
The backbone of an encoder is kept fixed, so its features are computed once and the
readout is fitted on the cached features (fast, and the same for a pretrained backbone
as for one that you trained yourself). `fit_readout_on_features` is the loop and the
only place where a readout is fitted: `NeuralEncoder.fit_readout` caches the features
and calls it, and so do the paper's scripts (`multigeom.fit.train_encoder`,
`multigeom.fit.layer_sweep`).
Functions
|
Pearson correlation per neuron over all images. |
|
Fit readout (features [N, C, S, S] -> responses [N, n_neurons]) with AdamW, a cosine schedule and mean squared error. |
Classes
|
What fit_readout did: the loss and correlation per epoch, and the epoch whose readout was kept. |