Tuning Analyses
Methods for characterizing neural response properties through gradient-based analyses.
Response Gradient Analysis
get_gradient_grid
get_gradient_grid(
stim: Tensor,
model_neuron: IncreaseObjective,
n_channels: int = 2,
start: float = -1,
stop: float = 1,
step_size: float = 0.1,
) -> tuple
Generate a grid of response gradients for a given stimulus and model neuron.
| PARAMETER | DESCRIPTION |
|---|---|
stim
|
The MEI stimulus.
TYPE:
|
model_neuron
|
The model neuron objective.
TYPE:
|
n_channels
|
The number of channels. Defaults to 2.
TYPE:
|
start
|
The starting value for the contrast range. Defaults to -1.
TYPE:
|
stop
|
The ending value for the contrast range. Defaults to 1.
TYPE:
|
step_size
|
The step size for the contrast range. Defaults to 0.1.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple
|
A tuple containing the following elements: - grid (ndarray): A grid of gradient values with shape (n_channels, len(green_contrast_values), len(uv_contrast_values)). - resp_grid (ndarray): A grid of loss values with shape (len(green_contrast_values), len(uv_contrast_values)). - norm_grid (ndarray): A grid of norm values with shape (len(green_contrast_values), len(uv_contrast_values)). - green_contrast_values (ndarray): An array of green contrast values. - uv_contrast_values (ndarray): An array of UV contrast values.
TYPE:
|
Source code in openretina/insilico/tuning_analyses/response_gradient.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
equalize_channels
equalize_channels(
stim: Tensor, flip_green: bool = False
) -> Tensor
Scale the channels of a stimulus to have equal norm, preserving total norm. Optionally flips green channel.
| PARAMETER | DESCRIPTION |
|---|---|
stim
|
Stimulus tensor of shape (1, 2, 50, 18, 16).
TYPE:
|
flip_green
|
Whether to flip the sign of the green channel.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Equalized stimulus tensor of the same shape. |
Source code in openretina/insilico/tuning_analyses/response_gradient.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |