tasks.probStim module

Author:Dominic Hunt
class tasks.probStim.Probstim(cues=None, actualities=None, trialsteps=100, numStimuli=4, correctProb=0.8, correctProbabilities=None, rewardlessT=None)[source]

Bases: tasks.taskTemplate.Task

Basic probabilistic

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:
  • actualities (int, optional) – The actual reality the cues pointed to. The correct response the participant is trying to get correct
  • cues (array of floats, optional) – The cues used to guess the actualities
  • trialsteps (int, optional) – If no provided cues, it is the number of trialsteps for the generated set of cues. Default 100
  • numStimuli (int, optional) – If no provided cues, it is the number of distinct stimuli for the generated set of cues. Default 4
  • correctProb (float in [0,1], optional) – If no actualities provided, it is the probability of the correct answer being answer 1 rather than answer 0. The default is 0.8
  • correctProbs (list or array of floats in [0,1], optional) – If no actualities provided, it is the probability of the correct answer being answer 1 rather than answer 0 for each of the different stimuli. Default [corrProb, 1-corrProb] * (numStimuli//2) + [corrProb] * (numStimuli%2)
  • rewardlessT (int, optional) – If no actualities provided, it is the number of actualities at the end of the tasks that will have a None reward. Default 2*numStimuli
feedback()[source]

Feedback to the action from the participant

proceed()[source]

Updates the task after feedback

receiveAction(action)[source]

Receives the next action from the participant

Parameters:action (int or string) – The action taken by the model
returnTaskState()[source]

Returns all the relevant data for this task run

Returns:results – A dictionary containing the class parameters as well as the other useful data
Return type:dictionary
storeState()[source]

Stores the state of all the important variables so that they can be output later

class tasks.probStim.RewardProbStimDiff(**kwargs)[source]

Bases: model.modelTemplate.Rewards

Processes the reward for models expecting reward corrections

processFeedback(feedback, lastAction, stimuli)[source]
Returns:
Return type:modelFeedback
class tasks.probStim.RewardProbStimDualCorrection(**kwargs)[source]

Bases: model.modelTemplate.Rewards

Processes the reward for models expecting the reward correction from two possible actions.

epsilon = 1
processFeedback(feedback, lastAction, stimuli)[source]
Returns:
Return type:modelFeedback
class tasks.probStim.StimulusProbStimDirect(**kwargs)[source]

Bases: model.modelTemplate.Stimulus

Processes the stimuli for models expecting just the event

processStimulus(observation)[source]

Processes the decks stimuli for models expecting just the event

Returns:
  • stimuliPresent (int or list of int) – The elements present of the stimulus
  • stimuliActivity (float or list of float) – The activity of each of the elements