SequenceTaskErrorCorrection¶
- class hive.implementation.sequence_task_err_corr.SequenceTaskErrorCorrection(action, trigger: Dict[str, Trigger])¶
Bases:
AbstractSequenceTaskProtocol for Sequence Task with Error Correction.
In this protocol, we put an animal in 8-arms maze. Giving a random 4-length sequence, the animal needs to learning and remember this visiting sequence in order to get the food reward. At the beginning, we open the door (according to mode open-selected or open-all), and the animal can free move to any arm (food give according to start-first or start-any). The next expected correct arm is according to the sequence. Once the animal made a mistake, if under with-correction , the animal needs to find the correct one, and any visit before correct won’t change the correct arms. If under without-correction. any visiting will change to the next expected arm.
Protocol conditions (mode).
without-door-close (MODE 1-) - We do nothing when the animal made a mistake.
with-door-close (MODE 1, MODE 1+) - We close the previous door which left from the un-expected arm, and reopen when the animal find the correct arm.
open-selected (MODE 2-) - we only open the selected doors (set in the sequence) at the beginning.
open-all (MODE 2, MODE 2+) - we open all of the doors at the beginning.
start-first (MODE 3-) - the first success visit should be the first arm in the sequence.
start-any (MODE 3, MODE 3+) - the first success visit can be any arm in the sequence.
without-correction (MODE 4-) - the next expected arm will change when the animal enter to any arms.
with-correction (MODE 4, MODE 4+) - the next expected arm will not change until the animal visit the correct arms.
food-consist (MODE 5-) - the mount of food given do not change over all session.
food-increase (MODE 5, MODE 5+) - the mount of food given increase when the animal visit the correct arm continuous.
Stopping conditions
the animal visited over max_trials arms.
the animal spent time_limit in the maze.
the animal stay on a platform over timeout. In this case, the animal does not have enough motivation to explore the maze.
Measurement of how good the animal’s performance
total successful visiting number over total visiting.
continuous successful visiting over 12~15 times.
extra mathematical analyze.
Use in config file
Task: mode : SequenceTaskErrorCorrection options: max_trial: 250 # (int) maximal number the animal can visit. time_out: 3600 # 1hr # (int) maximal duration the task can perform. time_stay: 600 # 10 min # (int) maximal duration the animal can stay on a platform. keyboard_shortcut: FDSAQWER mode: # See Protocol Conditions - without-correction - start-any - open-selected - without-door-close trigger : - name: Keyboard - name: Timer - name: Server
Devices used
Door devices named in D1, index from 1 to 8, and Food_delivery devices named in F1, index from 1 to 8.
Attributes Summary
Methods Summary
get_mode()get current modes list
Create the protocol.
set_mode([mode, verbose])print mode list or set mode
Attributes Documentation
- MODE_DOOR_CLOSE = 'with-door-close'¶
- MODE_DOOR_NOTHING = 'without-door-close'¶
- MODE_OPEN_ALL = 'open-all'¶
- MODE_OPEN_SELECTED = 'open-selected'¶
- MODE_START_ANY = 'start-any'¶
- MODE_START_FIRST = 'start-first'¶
- MODE_WITHOUT_CORR = 'without-correction'¶
- MODE_WITH_CORR = 'with-correction'¶
Methods Documentation
- new_seq_control() SequenceControl¶
Create the protocol.
Mode with correction:
ErrCorrSeqControlThe animal needs to follow a certain visiting sequence to get the rewards. Once the animal make a mistake by visiting un-expected arm, the animal needs to correct its choose by visiting the correct arm according to its last correct visited arm.Mode without correction:
DefaultSeqControlThe animal needs to follow a certain visiting sequence to get the rewards.