GoNoGo#
- class braintools.cogtask.GoNoGo(t_fixation=Quantity(500., 'ms'), t_stimulus=Quantity(500., 'ms'), t_delay=Quantity(500., 'ms'), t_response=Quantity(500., 'ms'), go_prob=0.5, noise_sigma=Quantity(1., 'ms^0.5'), **kwargs)[source]#
Go/No-Go task.
Agent must respond on ‘go’ trials and withhold response on ‘no-go’ trials.
Structure: Fixation >> Stimulus >> Delay >> Response
- Parameters:
t_fixation (
Quantity) – Fixation duration (default: 500ms).t_stimulus (
Quantity) – Stimulus duration (default: 500ms).t_delay (
Quantity) – Delay duration (default: 500ms).t_response (
Quantity) – Response duration (default: 500ms).go_prob (
float) – Probability of go trial (default: 0.5).noise_sigma (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Stimulus noise (default: 1.0 * u.ms**0.5).seed (int, optional) – Random seed.
Examples
>>> import brainunit as u >>> import braintools >>> task = braintools.cogtask.GoNoGo(seed=0, dt=10.0 * u.ms) >>> task.num_inputs, task.num_outputs (3, 3) >>> X, Y, info = task.sample_trial(0) >>> X.shape, Y.shape ((200, 3), (200,)) >>> >>> X, Y = task.batch_sample(4) # time-first: (T, batch, features) >>> X.shape, Y.shape ((200, 4, 3), (200, 4))
- define_features()[source]#
Define input and output features.
Override in subclass for class-based task definition.
- Return type:
- Returns:
input_features (Feature or FeatureSet) – Input feature definitions.
output_features (Feature or FeatureSet) – Output feature definitions.