ImmediateDirectionReproduction#

class braintools.cogtask.ImmediateDirectionReproduction(t_fixation=Quantity(300., 'ms'), t_go=Quantity(500., 'ms'), num_stimuli=8, noise_sigma=Quantity(0., 'ms^0.5'), base_value=0.0, feature_per_direction=1, IfVon=True, kappa=2.0, cue_dim=2, non_response_cue=None, response_cue=None, **kwargs)[source]#

Immediate Direction Reproduction task.

The agent reports the direction of a currently presented stimulus immediately, without any memory delay. The target output is a continuous 2D direction vector encoded as [cos(theta), sin(theta)], together with a fixation/output-gating signal.

Structure: Fixation >> Response

Parameters:
  • t_fixation (Duration) – Fixation duration before the go / response period (default: 300ms).

  • t_go (Duration) – Response period duration during which the stimulus is presented and the agent must report its direction immediately (default: 500ms).

  • num_stimuli (int) – Number of discrete stimulus directions uniformly distributed on the circle (default: 8).

  • noise_sigma (Data) – Input stimulus noise level (default: 0.0 * u.ms**0.5).

  • base_value (float) – Baseline value used by the stimulus encoder (default: 0.0).

  • feature_per_direction (int) – Number of repeated encoding features per direction. For von Mises encoding, the total stimulus dimension is num_stimuli * feature_per_direction. For cos/sin encoding, the total stimulus dimension is 2 * feature_per_direction (default: 1).

  • IfVon (bool) – Whether to use von Mises population encoding for the input stimulus. If False, use repeated cos/sin encoding instead (default: True).

  • kappa (float) – Concentration parameter for von Mises stimulus encoding (default: 2.0).

  • cue_dim (int) – Dimensionality of the fixation / task-state cue input (default: 2).

  • non_response_cue (array-like, optional) – Cue vector used during fixation phase. If None, defaults to [1, 0, …, 0].

  • response_cue (array-like, optional) – Cue vector used during the response phase. If None, defaults to [0, 1, 0, …, 0].

Notes

Input consists of: - a cue vector indicating task phase (fixation vs response), - a stimulus representation encoding the current direction.

Output consists of: - fixation_out: a scalar indicating whether fixation / withholding

should be maintained,

  • direction: a 2D continuous report of the current stimulus direction in [cos(theta), sin(theta)] form.

This task serves as a no-memory control for DelayedDirectionReproduction: both require continuous direction report, but only the delayed version requires working memory across a delay period.

Examples

>>> task = ImmediateDirectionReproduction()
>>> X, Y, info = task.sample_trial(0)
define_features()[source]#

Define input and output features.

Override in subclass for class-based task definition.

Returns:

  • input_features (Feature or FeatureSet) – Input feature definitions.

  • output_features (Feature or FeatureSet) – Output feature definitions.

define_phases()[source]#

Define the phase structure.

Override in subclass for class-based task definition.

Returns:

The task phase structure (single phase or composition).

Return type:

Phase

trial_init(ctx)[source]#

Initialize trial-level state.

Override in subclass to set up trial parameters like ground_truth, stimulus indices, etc.

Parameters:

ctx (Context) – Trial context to populate with state.