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)

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=PRFStimulusEncoder) – An encoding model class or instance. Model classes will be instantiated during initialization. The default creates a PRFStimulusEncoder instance.

  • 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 BaselineAmplitude instance.

Notes

The simple composite model follows three steps:

  1. The connective field response model makes a prediction for the stimulus distance matrix.

  2. The connective field response is encoded with the source response.

  3. The scaling model modifies the encoded 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, dtype: str | None = None) prfmodel.typing.Tensor

Predict a simple 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.

  • 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:

Tensor

property parameter_names: list[str]

A list with names of unique parameters that are used by the submodels.