DelayMatchCategory#

class braintools.cogtask.DelayMatchCategory(t_fixation=Quantity(300., 'ms'), t_sample=Quantity(650., 'ms'), t_delay=Quantity(1000., 'ms'), t_response=Quantity(500., 'ms'), num_categories=2, num_exemplars=4, match_prob=0.5, noise_sigma=Quantity(0., 'ms^0.5'), base_value=0.0, feature_per_direction=1, stimulus_encoding='one_hot', kappa=2.0, cue_dim=1, non_response_cue=None, response_cue=None, **kwargs)[source]#

Delayed Match-to-Category task.

Agent must remember the category of a sample stimulus and indicate whether a later comparison stimulus belongs to the same category.

Structure: Fixation >> Sample >> Delay >> Response

In the response phase, the comparison stimulus is presented together with the response cue, and the agent must decide whether it belongs to the same category as the sample.

Parameters:
  • t_fixation (Quantity) – Fixation duration (default: 300ms).

  • t_sample (Quantity) – Sample presentation duration (default: 650ms).

  • t_delay (Quantity) – Delay duration (default: 1000ms).

  • t_response (Quantity) – Response duration, during which the comparison stimulus is shown and the agent makes its decision (default: 500ms).

  • num_categories (int) – Number of categories (default: 2).

  • num_exemplars (int) – Number of exemplars per category (default: 6).

  • match_prob (float) – Probability that sample and comparison stimuli belong to the same category (default: 0.5).

  • noise_sigma (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Stimulus noise level (default: 0.0 * u.ms**0.5).

  • base_value (float) – Baseline activity added to encoded stimulus features (default: 0.0).

  • feature_per_direction (int) – Number of repeated encoded features per stimulus identity (default: 1).

  • stimulus_encoding (str) – Encoding scheme for discrete stimuli. Supported values: ‘one_hot’, ‘von_mises’, ‘circular’, ‘scalar’ (default: ‘one_hot’).

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

  • cue_dim (int) – Dimensionality of the fixation/response cue vector (default: 1).

  • non_response_cue (array-like, optional) – Cue vector used during fixation, sample, and delay phases. Defaults to a zero vector of length cue_dim.

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

  • seed (int, optional) – Random seed.

Examples

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

Define input and output features.

Override in subclass for class-based task definition.

Return type:

Tuple

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.

Return type:

None