Wrappers
block
¶
ScheduleAttr
¶
Bases: TrialWrapper
Schedule attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env
|
TrialEnv object |
required | |
schedule
|
|
required |
Source code in neurogym/wrappers/block.py
MultiEnvs
¶
Bases: TrialWrapper
Wrap multiple environments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
envs
|
list of env object |
required | |
env_input
|
bool, if True, add scalar inputs indicating current envinronment. default False. |
False
|
Source code in neurogym/wrappers/block.py
ScheduleEnvs
¶
Bases: TrialWrapper
Schedule environments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
envs
|
list of env object |
required | |
schedule
|
utils.scheduler.BaseSchedule object |
required | |
env_input
|
bool, if True, add scalar inputs indicating current environment. default False. |
False
|
Source code in neurogym/wrappers/block.py
reset
¶
Resets environments.
Reset each environment in self.envs and use the scheduler to select the environment returning the initial observation. This environment is also used to set the current environment self.env.
Source code in neurogym/wrappers/block.py
set_i
¶
Set the current environment to the i-th environment in the list envs.
TrialHistoryV2
¶
Bases: TrialWrapper
Change ground truth probability based on previous outcome.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
probs
|
matrix of probabilities of the current choice conditioned on the previous. Shape, num-choices x num-choices |
None
|
Source code in neurogym/wrappers/block.py
monitor
¶
Monitor
¶
Monitor(env, folder=None, sv_per=100000, sv_stp='trial', verbose=False, sv_fig=False, num_stps_sv_fig=100, name='', fig_type='png', step_fn=None)
Bases: Wrapper
Monitor task.
Saves relevant behavioral information: rewards, actions, observations, new trial, ground truth.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder
|
Folder where the data will be saved. (def: None, str) sv_per and sv_stp: Data will be saved every sv_per sv_stp's. (def: 100000, int) |
None
|
|
verbose
|
Whether to print information about average reward and number of trials. (def: False, bool) |
False
|
|
sv_fig
|
Whether to save a figure of the experiment structure. If True, a figure will be updated every sv_per. (def: False, bool) |
False
|
|
num_stps_sv_fig
|
Number of trial steps to include in the figure. (def: 100, int) |
100
|
Source code in neurogym/wrappers/monitor.py
noise
¶
Noise wrapper.
Created on Thu Feb 28 15:07:21 2019
@author: molano
Noise
¶
Bases: Wrapper
Add Gaussian noise to the observations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
std_noise
|
Standard deviation of noise. (def: 0.1) |
0.1
|
|
perf_th
|
If != None, the wrapper will adjust the noise so the mean performance is not larger than perf_th. (def: None, float) |
required | |
w
|
Window used to compute the mean performance. (def: 100, int) |
required | |
step_noise
|
Step used to increment/decrease std. (def: 0.001, float) |
required |
Source code in neurogym/wrappers/noise.py
pass_action
¶
PassAction
¶
Bases: Wrapper
Modifies observation by adding the previous action.
Source code in neurogym/wrappers/pass_action.py
pass_reward
¶
PassReward
¶
Bases: Wrapper
Modifies observation by adding the previous reward.
Source code in neurogym/wrappers/pass_reward.py
reaction_time
¶
Noise wrapper.
Created on Thu Feb 28 15:07:21 2019
@author: molano
ReactionTime
¶
Bases: Wrapper
Allow reaction time response.
Modifies a given environment by allowing the network to act at any time after the fixation period.
Source code in neurogym/wrappers/reaction_time.py
side_bias
¶
SideBias
¶
Bases: TrialWrapper
Changes the probability of ground truth.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prob
|
Specifies probabilities for each choice. Within each block,the probability should sum up to 1. (def: None, numpy array (n_block, n_choices)) |
required | |
block_dur
|
Number of trials per block. (def: 200, int) |
200
|