Skip to content

Commit 662f88e

Browse files
committed
start work on adaptiveTimeout task
1 parent f9b5a45 commit 662f88e

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

iblrig_custom_tasks/nate_adaptiveTimeoutChoiceWorld/__init__.py

Whitespace-only changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
This task inherits TrainingChoiceWorldSession with the addition of configurable, adaptive timeouts for incorrect
3+
choices depending on the stimulus contrast.
4+
"""
5+
6+
import logging
7+
from pathlib import Path
8+
9+
import yaml
10+
11+
from iblrig.base_choice_world import TrainingChoiceWorldSession
12+
from iblrig.misc import get_task_arguments
13+
from pybpodapi.state_machine import StateMachine
14+
15+
log = logging.getLogger('iblrig.task')
16+
17+
18+
# read defaults from task_parameters.yaml
19+
with open(Path(__file__).parent.joinpath('task_parameters.yaml')) as f:
20+
DEFAULTS = yaml.safe_load(f)
21+
22+
23+
class AdaptiveTimeoutStateMachine(StateMachine):
24+
def add_state(self, **kwargs):
25+
super().add_state(**kwargs)
26+
27+
28+
class Session(TrainingChoiceWorldSession):
29+
protocol_name = 'nate_adaptiveTimeoutChoiceWorld'
30+
31+
def __init__(self, *args, **kwargs):
32+
super().__init__(*args, **kwargs)
33+
34+
def _instantiate_state_machine(self, trial_number=None):
35+
return AdaptiveTimeoutStateMachine(self.bpod)
36+
37+
38+
if __name__ == '__main__': # pragma: no cover
39+
kwargs = get_task_arguments(parents=[Session.extra_parser()])
40+
sess = Session(**kwargs)
41+
sess.run()

iblrig_custom_tasks/nate_adaptiveTimeoutChoiceWorld/task_parameters.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)