Bandit task and timed bandit taks

119 views
Skip to first unread message

Alex Legaria

unread,
Sep 20, 2022, 1:32:36 PM9/20/22
to FEDforum
Hello! 

I am a graduate student at Lex's lab. I wanted to share some code I wrote for running a bandit task on FED. 

Briefly, in this task poking on the left or right poke leads probabilistically to the delivery of a pellet. For instance, poking on the left port may have a 70% probability of leading to a pellet, while poking on the right port may have a 30% probability of leading to a pellet. Additionally, the probabilities associated to each port change after certain number of pellets (or, optionally, after an n number of consecutive pokes in the high probability port). Here's an example of the output data: 
bandit_example.png
Here, each red dotted line show when the probabilities were changed. The numbers on top show the probabilities of getting a pellet after left or right poke, respectively. x-axis is number of total pokes, and y-axis is a smoothed probability of choosing the left port. In general, mice seem to learn to poke in the high probability pellet pretty well.

Additionally, I also wrote a timed version of this task, where the task is only available during a specific time of the day. When the trial is enabled, there is a set of tones (on sound) and the neopixels light on and remain on as long as the task is enabled. When the task is disabled, neopixels shut down, and there is another set of tones (off sound).

I am attaching here the code for both versions of the task and a brief description of the task and of some important code variables. I'd love to hear if anyone tests this code, and about any bugs you may find.  Let me know if you have any questions!

Alex Legaria


bandit_task.zip
timed_bandit_task.zip
Reply all
Reply to author
Forward
0 new messages