prfmodel.models.cf.canonical.CanonicalCFModel¶
- class prfmodel.models.cf.canonical.CanonicalCFModel(cf_model: prfmodel.models.base.BasePopulationResponse, encoding_model: prfmodel.models.base.BaseStimulusEncoder | type[prfmodel.models.base.BaseStimulusEncoder] = CFStimulusEncoder, scaling_model: prfmodel.scaling.base.BaseScaling | type[prfmodel.scaling.base.BaseScaling] | None = BaselineAmplitude, regressors_model: prfmodel.regressors.base.BaseRegressors | list[prfmodel.regressors.base.BaseRegressors] | None = None)¶
Canonical connective field model.
This class combines a connective field and scaling model response.
- Parameters:
cf_model (BasePopulationResponse) – A connective field response model instance.
encoding_model (BaseStimulusEncoder or type, default=CFStimulusEncoder) – An stimulus encoding model class or instance. Model classes will be instantiated during initialization. The default creates a
CFStimulusEncoderinstance.scaling_model (BaseScaling or type or None, default=BaselineAmplitude, optional) – A scaling model class or instance. Model classes will be instantiated during initialization. The default creates a
BaselineAmplitudeinstance.regressors_model (BaseRegressors or list of BaseRegressors or RegressorsList or None, default=None, optional) – A regressor model instance, a list of regressor model instances, or None. When a list is provided, it is wrapped in a
RegressorsListand its contributions are summed. The regressor contribution is added after the scaling model.
Notes
The canonical model follows the following steps:
The connective field response model makes a prediction for the stimulus distance matrix.
The connective field response is encoded with the source response.
The scaling model modifies the encoded response.
The regressors model (optional) adds a linear combination of fixed regressors to the scaled response.
In contrast to pRF models (e.g.,
CanonicalPRFModel), connective field models do not require an impulse model because it already contained in the signal of the source response.- __call__(stimulus: prfmodel.stimuli.CFStimulus, parameters: pandas.DataFrame, regressors: pandas.DataFrame | None = None, dtype: str | None = None) prfmodel.typing.Tensor¶
Predict a canonical connective field model response to a stimulus.
- Parameters:
stimulus (CFStimulus) – Connective field stimulus object.
parameters (pandas.DataFrame) – Dataframe with columns containing different model parameters and rows containing parameter values for different units.
regressors (pandas.DataFrame, optional) – Regressor design data. Required when the canonical model has a regressors model configured. A single data frame with shape (num_frames, num_regressors) whose columns cover the names required by every configured regressor model. Extra columns are ignored.
dtype (str, optional) – The dtype of the prediction result. If None (the default), uses the dtype from
prfmodel.utils.get_dtype().
- Returns:
The predicted model response with shape (num_units, num_frames) and dtype dtype.
- Return type: