Shaping (New) - theunissenlab/lab-documentation GitHub Wiki
Shaping
The shaping procedure originally developed by Julie works quite nicely and takes about 1-2 weeks. Nearly every subject will successfully learn the task (though we've seen that males seem to be slower to explore at the beginning). The original documentation is on Google Drive.
Shaping can typically take as few as 2-3 days for some subjects, and 1-2 weeks for others. Follow the instructions for preparing the pecking test chambers. If vocalization recordings are needed from these subjects, this is also a good time to collect them.
0 Setup
Set up the configuration YAML files in /data/pecking_test/configs. Open them with
pecking-test edit-config
Set the subject_name variable to be the subject's name and point the stim_directory to /data/pecking_test/stimuli/shaping/shaping_songID (or whichever stim set you want to use). For example:
# Experiment properties
subject_name: &subject RedBlu0000M
# File paths
stim_base_dir: &stimbase "/data/pecking_test/stimuli"
stim_directory: &stims "/data/pecking_test/stimuli/shaping/shaping_songID"
- Bring the subjects
1 Acclimating
Weigh the subjects and note their initial weights. The house the subjects in pairs in two operant boxes with fresh water. Bring the feeders up (do this per box)
pecking-test shell -b 2
In [1]: box2.feeder.up()
Its best to start this around noon the day before. Let them sit in the boxes as pairs overnight. Make sure to lower the feeder at night and to raise it early the next morning, as the light is quite bright.
Being in a pair should help them feel more comfortable to explore the box and find the food port within a day.
2 Finding the food port
Next we verify that the birds are aware of the feeder and get them to start to associate the sound of the feeder with food. When you see them eating from it, run the following command:
In[1]: box2.feeder.feed(30)
This will let them eat for 30 seconds before lowering the feeder.
When it appears the birds all know about the food port, they can be separated.
Move the subjects so that there is one subject per box and repeat the above steps. When they start to eat, run box2.feeder.feed(30) (adjust for the relevant box number).
Feed the bird that way 3 to 5 times waiting 1-2 min minimum between each feed.
Once this is done, quit the python shell with quit() and move on to the next step.
3 Finding the button
Next its time for the birds to find the button. In each box, tape some seed on the button as well as some seed on the wall next to the button.
Run the pecking test with 100% rewarded stimuli:
pecking-test shape -b 2 -r 1.0
When the bird pecks the key and jumps down to eat a few times, end the test with CTRL+C and move on to the next step.
Sometimes birds have a very hard time making that first button press because they are not exploring the box. They either don't do anything or become fixated with the feed port and stick there head deeper and deeper in. If this goes on for a while, it can help to pair a bird who has learned to peck in the same box for a short bit to help the struggling bird gain interest in the button.
4 Learning the task
Now we are going to gradually decrease the frequency of rewarded stimuli. This part can vary based on the behavior of the bird (how many trials they are doing), and you may need to go back up a few times. Our guideline is to decrease the reward percentage each time the bird feeds by itself 5-10 times at a level.
Change the -r parameter to decrease from 1.0 to 0.2. Some good intermediate steps are 0.8, 0.5, 0.4, 0.3, 0.2. At the lower probabilities there are sometimes very long streaks of no reward, so try to make sure the bird is really getting it before lowering it too far.
pecking-test shape -b 2 -r 0.8
pecking-test shape -b 2 -r 0.5
...etc
When the bird are at 20% rewarded, you can run the pecking test normally.
pecking-test run -b 2
Let them work at this level (20% rewarded) until they are interrupting the nonrewarded stimuli at a significantly higher rate than the rewarded. You can verify this by checking the Jupyter notebook (localhost:8888 on plump) or using
pecking-test data
5 Finished
When you move on to the real test, don't forget to edit the config files to change the stimulus directories.