prfmodel.utils

Utility functions.

Classes

TensorFrame

A dictionary-like object that supports dataframe-style column selection but returns Keras tensors.

Functions

as_tensor_frame(→ TensorFrame)

Convert user-supplied parameters into the tensor-holding representation.

batched(→ collections.abc.Callable)

Decorate a model prediction function to make batched predictions.

calculate_eccentricity(→ numpy.ndarray)

Calculate the eccentricity of two-dimensional population receptive field (pRF) centers.

calculate_polar_angle(→ numpy.ndarray)

Calculate the polar angle of two-dimensional population receptive field (pRF) centers.

calculate_r_squared(→ numpy.ndarray)

Calculate the coefficient of determination (R-squared) of predicted responses for each unit.

convert_parameters_to_tensor(→ prfmodel.typing.Tensor)

Convert model parameters in a dataframe into a tensor.

get_dtype(→ str)

Get the (default) dtype.

normalize_response(→ prfmodel.typing.Tensor)

Normalize a response.

Module Contents

prfmodel.utils.DTYPES

Accepted dtypes for prfmodel.typing.Tensor objects.

Accepted dtypes are: “float16”, “float32”, and “float64”.