prfmodel.impulse.base¶
Impulse model base classes.
Classes in this module inherit from ModelProtocol that requires them to implement a
parameter_names property.
They are abstract base classes, meaning that they
cannot be instantiated on their own but are intended as parent classes that define attributes and methods that are
shared by all child classes. For example, BaseImpulse defines that all child classes
must implement a call() method that takes a set of parameters
as input. However, it leaves it up to each child class to define how input parameters are used to make
model predictions.
All base classes have a concrete user-facing :meth:__call__ method
(e.g., __call__()) that takes non-tensor arguments and
performs validation checks. This method calls the abstract call method that must be implemented by each child
class and only accepts tensor arguments to enable backend compilation.
The user-facing __call__() returns a numpy.ndarray, while call returns a backend tensor.
Use call when a backend tensor is required, for example inside a fitter or another model’s call.
Impulse models can have default parameters that are defined during initialization. The default parameters are added to the user-supplied parameter dataframe (replicating the default value for each unit) in the __call__ method if not already present.
Classes¶
Abstract base class for impulse models. |
Module Contents¶
- prfmodel.impulse.base.P¶
the user-facing data frame or its tensor-holding counterpart.
- Type:
Either representation of a parameter table