tasks.probSelect module¶
Author: | Dominic Hunt |
---|---|
Reference: | Genetic triple dissociation reveals multiple roles for dopamine in reinforcement learning. Frank, M. J., Moustafa, A. a, Haughey, H. M., Curran, T., & Hutchison, K. E. (2007). Proceedings of the National Academy of Sciences of the United States of America, 104(41), 16311–16316. doi:10.1073/pnas.0706111104 |
-
class
tasks.probSelect.
ProbSelect
(reward_probability=0.7, learning_action_pairs=None, action_reward_probabilities=None, learning_length=240, test_length=60, number_actions=None, reward_size=1)[source]¶ Bases:
tasks.taskTemplate.Task
- Probabilistic selection task based on Genetic triple dissociation reveals multiple roles for dopamine in reinforcement learning.
- Frank, M. J., Moustafa, A. a, Haughey, H. M., Curran, T., & Hutchison, K. E. (2007). Proceedings of the National Academy of Sciences of the United States of America, 104(41), 16311–16316. doi:10.1073/pnas.0706111104
Many methods are inherited from the tasks.taskTemplate.Task class. Refer to its documentation for missing methods.
-
Name
¶ The name of the class used when recording what has been used.
Type: string
Parameters: - reward_probability (float in range [0,1], optional) – The probability that a reward is given for choosing action A. Default is 0.7
- action_reward_probabilities (dictionary, optional) – A dictionary of the potential actions that can be taken and the probability of a reward. Default {0:rewardProb, 1:1-rewardProb, 2:0.5, 3:0.5}
- learning_action_pairs (list of tuples, optional) – The pairs of actions shown together in the learning phase.
- learning_length (int, optional) – The number of trials in the learning phase. Default is 240
- test_length (int, optional) – The number of trials in the test phase. Default is 60
- reward_size (float, optional) – The size of reward given if successful. Default 1
- number_actions (int, optional) – The number of actions that can be chosen at any given time, chosen at random from actRewardProb. Default 4
Notes
The task is broken up into two sections: a learning phase and a transfer phase. Participants choose between pairs of four actions: A, B, M1 and M2. Each provides a reward with a different probability: A:P>0.5, B:1-P<0.5, M1=M2=0.5. The transfer phase has all the action pairs but no feedback. This class only covers the learning phase, but models are expected to be implemented as if there is a transfer phase.
-
next
()[source]¶ Produces the next stimulus for the iterator
Returns: - stimulus (None)
- next_valid_actions (Tuple of length 2 of ints) – The list of valid actions that the model can respond with.
Raises: StopIteration
-
receiveAction
(action)[source]¶ Receives the next action from the participant
Parameters: action (int or string) – The action taken by the model
-
class
tasks.probSelect.
RewardProbSelectDirect
(**kwargs)[source]¶ Bases:
model.modelTemplate.Rewards
Processes the probabilistic selection reward for models expecting just the reward
-
class
tasks.probSelect.
StimulusProbSelectDirect
(**kwargs)[source]¶ Bases:
model.modelTemplate.Stimulus
Processes the selection stimuli for models expecting just the event
Examples
>>> stim = StimulusProbSelectDirect() >>> stim.processStimulus(1) (1, 1) >>> stim.processStimulus(0) (1, 1)