예제 #1
0
                            y_psb = ['us'],
                            order_fixed = True,
                            iti = iti,
                            n_rep = n_rep_train)

extra_us_ctl_stage = expr.stage(x_pn = [[]],
                                x_bg = ['ctx'],
                                y_psb = ['us'],
                                order_fixed = True,
                                iti = 0,
                                n_rep = (iti + 1)*n_rep_train)

##### DEFINE SCHEDULES #####

# no conditioning (as a very basic control)
no_cond = expr.schedule(resp_type = 'exct', stages = {'test': test_stage})

# basic conditioning
cond = expr.schedule(resp_type = 'exct', stages = {'cond': training_stage, 'test': test_stage})

# blocking
blocking = expr.schedule(resp_type = 'exct', stages = {'one_cue': one_cue_stage, 'two_cue': two_cue_stage, 'test': test_cs2_stage})

# two cue conditioning (e.g. overshadowing)
two_cue = expr.schedule(resp_type = 'exct', stages = {'two_cue': two_cue_stage, 'test': test_cs2_stage})

# pre-exposure (for latent inhibition)
pre_exp = expr.schedule(resp_type = 'exct', stages = {'pre_exposure': pre_exp_stage, 'cond': training_stage, 'test': test_stage})

# pre-exposure (ABC)
pre_exp_abc = expr.schedule(resp_type = 'exct', stages = {'pre_exposure': pre_exp_ctx_a_stage, 'cond': training_ctx_b_stage, 'test': test_ctx_c_stage})
예제 #2
0
import pandas as pd
from statsrat import expr
'''
Simplified category learning tasks (smaller versions of the tasks like those in 'cat' -> 'kitten').
'''

# learned predictiveness
design = expr.schedule(resp_type = 'choice',
                      stages = {'relevance': expr.stage(x_pn = [['a', 'x'], ['a', 'y'], ['b', 'x'], ['b', 'y']],
                                                        y = [['cat1'], ['cat1'], ['cat2'], ['cat2']],
                                                        n_rep = 10),
                                'transfer': expr.stage(x_pn = [['a', 'x'], ['b', 'y']],
                                                       y = [['cat3'], ['cat4']],
                                                       n_rep = 10),
                                'test': expr.stage(x_pn = [['a', 'y'], ['b', 'x']],
                                                   y_psb = ['cat3', 'cat4'],
                                                   lrn = False,
                                                   n_rep = 1)})

rel_irl_oat = expr.oat(schedule_pos = ['design'],
                      behav_score_pos = expr.behav_score(stage = 'test',
                                                        trial_pos = ['a.y -> nothing', 'b.x -> nothing'],
                                                        trial_neg = ['a.y -> nothing', 'b.x -> nothing'],
                                                        resp_pos = ['cat3', 'cat4'],
                                                        resp_neg = ['cat4', 'cat3']))

learned_predictiveness = expr.experiment(schedules = {'design': design},
                                         oats = {'rel_irl': rel_irl_oat})

del design; del rel_irl_oat
예제 #3
0
                       iti=iti,
                       n_rep=n_rep_test)

test_different = expr.stage(x_pn=[['cs1']],
                            x_bg=['ctx_b2'],
                            y_psb=['us'],
                            order_fixed=True,
                            iti=iti,
                            n_rep=n_rep_test)

# group "same"
same = expr.schedule(resp_type='exct',
                     stages={
                         'cond': training,
                         'ex_cs1': extinction_cs1,
                         'ex_cs2': extinction_cs2,
                         'ex_cs2': extinction_cs2,
                         'ex_cs1': extinction_cs1,
                         'test': test_same
                     })

# group "different"
different = expr.schedule(resp_type='exct',
                          stages={
                              'cond': training,
                              'ex_cs1': extinction_cs1,
                              'ex_cs2': extinction_cs2,
                              'ex_cs2': extinction_cs2,
                              'ex_cs1': extinction_cs1,
                              'test': test_different
                          })
예제 #4
0
design = expr.schedule(resp_type = 'choice',
                  stages = {
                      'tutorial_0a': expr.stage(
                            x_pn = [['alpha'], ['beta']],
                            y = [['cati'], ['catii']],
                            y_psb = ['cati', 'catii'],
                            n_rep = 6),
                      'tutorial_0b': expr.stage(
                            x_pn = [['alpha'], ['beta']],
                            y = [['cati'], ['catii']],
                            y_psb = ['cati', 'catii'],
                            n_rep = 6),
                      'tutorial_0c': expr.stage(
                            x_pn = [['alpha', 'theta'], ['beta', 'theta'], ['alpha', 'phi'], ['beta', 'phi']],
                            y = 2*[['cati'], ['catii']],
                            y_psb = ['cati', 'catii'],
                            n_rep = 6),
                      'relevance': expr.stage(
                            x_pn = [['b1', 't1'], ['b1', 't2'], ['b2', 't1'], ['b2', 't2'], ['t3', 'b3'], ['t3', 'b4'], ['t4', 'b3'], ['t4', 'b4']],
                            y = 2*[['cat1'], ['cat1'], ['cat2'], ['cat2']],
                            y_psb = ['cat1', 'cat2'],
                            n_rep = 12),
                      'transfer': expr.stage(
                            x_pn = [['t5', 'b5'], ['t6', 'b6'], ['t1', 'b1'], ['t2', 'b2'], ['t3', 'b3'], ['t4', 'b4']],
                            y = 3*[['cat3'], ['cat4']],
                            y_psb = ['cat3', 'cat4'],
                            n_rep = 8),
                      'test': expr.stage(
                            x_pn = [['t5', 'b6'], ['t6', 'b5'], ['t1', 'b2'], ['t2', 'b1'], ['t3', 'b4'], ['t4', 'b3']],
                            y_psb = ['cat3', 'cat4'],
                            lrn = False,
                            n_rep = 2)},
                   x_dims = {'fruits': ['alpha', 'beta', 'theta', 'phi'], 'benign_faces': ['b1', 'b2', 'b3', 'b4', 'b5', 'b6'], 'angry_faces': ['t1', 't2', 't3', 't4', 't5', 't6']})
예제 #5
0
'''
Inverse base rate effect (IBRE) and related experiments.
'''

##### BASIC INVERSE BASE RATE EFFECT DESIGN #####

# Kruschke (1996), Experiment 1 (inverse base rate effect)
# I'm missing some of the test trial types.
design = expr.schedule(resp_type='choice',
                       stages={
                           'training':
                           expr.stage(freq=[3, 1, 3, 1],
                                      x_pn=[['i1', 'pc1'], ['i1', 'pr1'],
                                            ['i2', 'pc2'], ['i2', 'pr2']],
                                      y=[['c1'], ['r1'], ['c2'], ['r2']],
                                      y_psb=['c1', 'r1', 'c2', 'r2'],
                                      n_rep=15),
                           'test':
                           expr.stage(x_pn=[['pc1'], ['pr1'], ['pc2'], ['pr2'],
                                            ['pc1', 'pr1'], ['pc2', 'pr2']],
                                      y_psb=['c1', 'r1', 'c2', 'r2'],
                                      lrn=False,
                                      n_rep=2)
                       })

pc_pr = expr.oat(schedule_pos=['design'],
                 behav_score_pos=expr.behav_score(
                     stage='test',
                     trial_pos=['pc1.pr1 -> nothing', 'pc2.pr2 -> nothing'],
                     trial_neg=['pc1.pr1 -> nothing', 'pc2.pr2 -> nothing'],
                     resp_pos=['r1', 'r2'],
                     resp_neg=['c1', 'c2']))
예제 #6
0
extra_us_ctl_stage_t2 = expr.stage(x_pn=[[]],
                                   x_bg=['ctx', 'time'],
                                   x_value=pd.Series({
                                       'cs': 1.0,
                                       'ctx': 1.0,
                                       'time': 2.0
                                   }),
                                   y_psb=['us'],
                                   order_fixed=True,
                                   iti=0,
                                   n_rep=(iti + 1) * n_rep_train)

##### DEFINE SCHEDULES #####

# no conditioning (as a very basic control)
no_cond = expr.schedule(resp_type='exct', stages={'test': test_stage_t0})

# basic conditioning
cond = expr.schedule(resp_type='exct',
                     stages={
                         'cond': training_stage_t0,
                         'test': test_stage_t1
                     })

# blocking
blocking = expr.schedule(resp_type='exct',
                         stages={
                             'one_cue': one_cue_stage_t0,
                             'two_cue': two_cue_stage_t1,
                             'test': test_cs2_stage_t2
                         })