prfmodel.scaling.Baseline¶
- class prfmodel.scaling.Baseline¶
Additive baseline scaling model.
Transforms a temporal response by adding a baseline.
Examples
>>> import numpy as np >>> import pandas as pd >>> params = pd.DataFrame({ ... "baseline": [5.0, 10.0, -3.0], ... }) >>> num_frames = 10 >>> inputs = np.ones((params.shape[0], num_frames)) >>> model = Baseline() >>> resp = model(inputs, params) >>> print(resp.shape) # (num_units, num_frames) (3, 10)
- __call__(inputs: prfmodel.typing.Tensor, parameters: pandas.DataFrame, dtype: str | None = None) prfmodel.typing.Tensor¶
Predict the model response.
- Parameters:
inputs (
prfmodel.typing.Tensor) – Input tensor with temporal response and shape (num_units, num_frames).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: