<commit_before>"""
A parametric working memory task, based on

  Neuronal population coding of parametric working memory.
  <NAME>, <NAME>, & <NAME>, JNS 2010.

  http://dx.doi.org/10.1523/JNEUROSCI.1875-10.2010

"""
from __future__ import division

import numpy as np

from pyrl import tasktools

# Inputs
inputs = tasktools.to_map('FIXATION', 'F-POS', 'F-NEG')

# Actions
actions = tasktools.to_map('FIXATE', '>', '<')

# Trial conditions
gt_lts = ['>', '<']
fpairs = [(18, 10), (22, 14), (26, 18), (30, 22), (34, 26)]
n_conditions = len(gt_lts) * len(fpairs)

# Training
n_gradient   = n_conditions
n_validation = 20*n_conditions

# Input noise
sigma = np.sqrt(2*100*0.0001)

# Recurrent noise
#var_rec = 0.015

# Epoch durations
fixation  = 750
f1        = 500
delay_min = 3000 - 300
delay_max = 3000# + 300
f2        = 500
decision  = 500
tmax      = fixation + f1 + delay_max + f2 + decision

def get_condition(rng, dt, context={}):
    #-------------------------------------------------------------------------------------
    # Epochs
    #-------------------------------------------------------------------------------------

    delay = delay_max
    #delay = context.get('delay')
    #if delay is None:
    #    delay = tasktools.uniform(rng, dt, delay_min, delay_max)

    durations = {
        'fixation':   (0, fixation),
        'f1':         (fixation, fixation + f1),
        'delay':      (fixation + f1, fixation + f1 + delay),
        'f2':         (fixation + f1 + delay, fixation + f1 + delay + f2),
        'decision':   (fixation + f1 + delay + f2, tmax),
        'tmax':       tmax
        }
    time, epochs = tasktools.get_epochs_idx(dt, durations)

    gt_lt = context.get('gt_lt')
    if gt_lt is None:
        gt_lt = tasktools.choice(rng, gt_lts)

    fpair = context.get('fpair')<commit_msg>Initial commit<commit_after>"""
A parametric working memory task, based on

  Neuronal population coding of parametric working memory.
  <NAME>, <NAME>, & <NAME>, JNS 2010.

  http://dx.doi.org/10.1523/JNEUROSCI.1875-10.2010

"""
from __future__ import division

import numpy as np

from pyrl import tasktools

# Inputs
inputs = tasktools.to_map('FIXATION', 'F-POS', 'F-NEG')

# Actions
actions = tasktools.to_map('FIXATE', '>', '<')

# Trial conditions
gt_lts = ['>', '<']
fpairs = [(18, 10), (22, 14), (26, 18), (30, 22), (34, 26)]
n_conditions = len(gt_lts) * len(fpairs)

# Training
n_gradient   = n_conditions
n_validation = 20*n_conditions

# Input noise
sigma = np.sqrt(2*100*0.0001)

# Recurrent noise
var_rec = 0.015

# Epoch durations
fixation  = 750
f1        = 500
delay_min = 3000 - 300
delay_max = 3000 + 300
f2        = 500
decision  = 500
tmax      = fixation + f1 + delay_max + f2 + decision

def get_condition(rng, dt, context={}):
    #-------------------------------------------------------------------------------------
    # Epochs
    #-------------------------------------------------------------------------------------

    delay = context.get('delay')
    if delay is None:
        delay = tasktools.uniform(rng, dt, delay_min, delay_max)

    durations = {
        'fixation':   (0, fixation),
        'f1':         (fixation, fixation + f1),
        'delay':      (fixation + f1, fixation + f1 + delay),
        'f2':         (fixation + f1 + delay, fixation + f1 + delay + f2),
        'decision':   (fixation + f1 + delay + f2, tmax),
        'tmax':       tmax
        }
    time, epochs = tasktools.get_epochs_idx(dt, durations)

    gt_lt = context.get('gt_lt')
    if gt_lt is None:
        gt_lt = tasktools.choice(rng, gt_lts)

    fpair = context.get('fpair')
{'fraction_non_alphanumeric': 0.22430939226519336, 'fraction_numerical': 0.05303867403314917, 'mean_word_length': 2.004979253112033, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7355516', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1196, 'n_words': 310}