SequenceTaskErrorCorrection

class hive.implementation.sequence_task_err_corr.SequenceTaskErrorCorrection(action, trigger: Dict[str, Trigger])

Bases: AbstractSequenceTask

Protocol 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).

  1. without-door-close (MODE 1-) - We do nothing when the animal made a mistake.

  2. 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.

  3. open-selected (MODE 2-) - we only open the selected doors (set in the sequence) at the beginning.

  4. open-all (MODE 2, MODE 2+) - we open all of the doors at the beginning.

  5. start-first (MODE 3-) - the first success visit should be the first arm in the sequence.

  6. start-any (MODE 3, MODE 3+) - the first success visit can be any arm in the sequence.

  7. without-correction (MODE 4-) - the next expected arm will change when the animal enter to any arms.

  8. with-correction (MODE 4, MODE 4+) - the next expected arm will not change until the animal visit the correct arms.

  1. food-consist (MODE 5-) - the mount of food given do not change over all session.

  2. food-increase (MODE 5, MODE 5+) - the mount of food given increase when the animal visit the correct arm continuous.

Stopping conditions

  1. the animal visited over max_trials arms.

  2. the animal spent time_limit in the maze.

  3. 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

  1. total successful visiting number over total visiting.

  2. continuous successful visiting over 12~15 times.

  3. 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.

../_images/sequence_task_err_corr.png

Attributes Summary

MODE_DOOR_CLOSE

MODE_DOOR_NOTHING

MODE_OPEN_ALL

MODE_OPEN_SELECTED

MODE_START_ANY

MODE_START_FIRST

MODE_WITHOUT_CORR

MODE_WITH_CORR

Methods Summary

get_mode()

get current modes list

new_seq_control()

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

get_mode() List[str]

get current modes list

new_seq_control() SequenceControl

Create the protocol.

  • Mode with correction: ErrCorrSeqControl The 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: DefaultSeqControl The animal needs to follow a certain visiting sequence to get the rewards.

set_mode(mode: Optional[str] = None, verbose=True)

print mode list or set mode