Core
TrialEnv
¶
Bases: BaseEnv
The main Neurogym class for trial-based envs.
Source code in neurogym/core.py
seed
¶
Set random seed.
Source code in neurogym/core.py
post_step
¶
Optional task-specific wrapper applied at the end of step.
It allows to modify ob online (e.g. provide a specific observation for different actions made by the agent)
Source code in neurogym/core.py
new_trial
¶
Public interface for starting a new trial.
Returns:
Name | Type | Description |
---|---|---|
trial |
dict of trial information. Available to step function as self.trial |
Source code in neurogym/core.py
step
¶
Public interface for the environment.
Source code in neurogym/core.py
reset
¶
Reset the environment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seed
|
random seed, overwrites self.seed if not None |
None
|
|
options
|
additional options used to reset the env.
Can include 'step_fn' and 'no_step'.
|
None
|
Source code in neurogym/core.py
render
¶
set_top
¶
add_period
¶
Add an period.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
period
|
string or list of strings, name of the period |
required | |
duration
|
float or None, duration of the period if None, inferred from timing_fn |
None
|
|
before
|
(optional) str, name of period that this period is before |
None
|
|
after
|
(optional) str, name of period that this period is after or float, time of period start |
None
|
|
last_period
|
bool, default False. If True, then this is last period will generate self.tmax, self.tind, and self.ob |
False
|
Source code in neurogym/core.py
view_ob
¶
add_ob
¶
Add value to observation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
array-like (ob_space.shape, ...) |
required | |
period
|
string, must be name of an added period |
None
|
|
where
|
string or np array, location of stimulus to be added |
None
|
Source code in neurogym/core.py
set_groundtruth
¶
Set groundtruth value.
Source code in neurogym/core.py
view_groundtruth
¶
in_period
¶
BaseEnv
¶
Bases: Env
The base Neurogym class to include dt.