コード例 #1
0
ファイル: pvl_iti.py プロジェクト: SamPaskewitz/statsrat
This version includes inter-trial intervals (ITIs).
'''

iti = 5
n_rep_train = 5
n_rep_extn = 5
n_rep_test = 2
n_rep_pre_exp = 5
n_rep_no_stim = 10

##### DEFINE STAGES #####

no_stim_stage = expr.stage(x_pn = [[]],
                           x_bg = ['ctx'],
                           y_psb = ['us'],
                           order_fixed = True,
                           iti = 0,
                           n_rep = n_rep_no_stim)

no_stim_ctx_a_stage = expr.stage(x_pn = [[]],
                                 x_bg = ['ctx_a'],
                                 y_psb = ['us'],
                                 order_fixed = True,
                                 iti = 0,
                                 n_rep = n_rep_no_stim)

test_stage = expr.stage(x_pn = [['cs']],
                        x_bg = ['ctx'],
                        y_psb = ['us'],
                        order_fixed = True,
                        iti = iti,
コード例 #2
0
ファイル: kitten.py プロジェクト: SamPaskewitz/statsrat
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
The ITI was 2 minutes (4 times the CS length).

The test took place on day 4, and consisted of 4 trials.  The ITI was 2 minutes (4 times the CS length).
"""

from statsrat import expr

iti = 5
n_rep_train = 5
n_rep_extn = 10
n_rep_test = 5

training = expr.stage(x_pn=[['cs1'], ['cs2']],
                      x_bg=['ctx_a'],
                      y=2 * [['us']],
                      y_psb=['us'],
                      order_fixed=True,
                      iti=iti,
                      n_rep=n_rep_train)

extinction_cs1 = expr.stage(x_pn=[['cs1']],
                            x_bg=['ctx_b1'],
                            y_psb=['us'],
                            order_fixed=True,
                            iti=iti,
                            n_rep=n_rep_extn)

extinction_cs2 = expr.stage(x_pn=[['cs2']],
                            x_bg=['ctx_b2'],
                            y_psb=['us'],
                            order_fixed=True,
コード例 #4
0
from statsrat import expr

# Category learning tasks.

# FAST (Joel Stoddard collab)
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'],
コード例 #5
0
ファイル: base_rate.py プロジェクト: SamPaskewitz/statsrat
from statsrat import expr
'''
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'],
コード例 #6
0
ファイル: pvl_time_cue.py プロジェクト: SamPaskewitz/statsrat
iti = 5
n_rep_train = 5
n_rep_extn = 5
n_rep_test = 2
n_rep_pre_exp = 5
n_rep_no_stim = 10

##### DEFINE STAGES #####

no_stim_stage_t0 = expr.stage(x_pn=[[]],
                              x_bg=['ctx', 'time'],
                              x_value=pd.Series({
                                  'cs': 1.0,
                                  'ctx': 1.0,
                                  'time': 0.0
                              }),
                              y_psb=['us'],
                              order_fixed=True,
                              iti=0,
                              n_rep=n_rep_no_stim)

no_stim_ctx_a_stage_t0 = expr.stage(x_pn=[[]],
                                    x_bg=['ctx_a', 'time'],
                                    x_value=pd.Series({
                                        'cs': 1.0,
                                        'ctx_a': 1.0,
                                        'time': 0.0
                                    }),
                                    y_psb=['us'],
                                    order_fixed=True,