Migrating to 0.7¶
Since braincoder 0.7, a model object holds only its configuration: the tuning function, the stimulus grid, the HRF. It never stores data, parameters, weights or a noise model, so nothing you did earlier can change what a later call computes.
Passing a removed argument to a constructor raises a TypeError that points here, and leaving
out required inputs raises a ValueError, so old code fails loudly.
In short¶
Before 0.7 |
Since 0.7 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Select the voxels in your own |
ParameterFitter(model, data, paradigm) and WeightFitter(model, parameters, data, paradigm)
are unchanged. ResidualFitter and StimulusFitter keep the same arguments, but parameters
is now required for any model that has parameters.
New fitting default¶
ParameterFitter.fit now defaults to r2_atol=1e-4, so fits stop earlier. To reproduce a fit from an
earlier version, pass r2_atol=1e-6.
Custom models¶
Subclasses need two changes:
Remove
paradigm,data,parameters,weightsandomegafrom__init__, and from the call tosuper().__init__.Replace
self.parameters,self.weights,self.omegaandself.paradigmwith method arguments.
_basis_predictions(paradigm, parameters) and transformations work as before.
A subclass whose paradigm has more than one stimulus dimension and that uses StimulusFitter should
pass n_dimensions to the base constructor.