graduation

Object that implement Graduation criteria to move between different tasks in a protocol.

Classes:

Accuracy([threshold, window])

Graduate stage based on percent accuracy over some window of trials.

Graduation()

Base Graduation object.

NTrials(n_trials[, current_trial])

Graduate after doing n trials

count

count(start=0, step=1) –> count object

deque

deque([iterable[, maxlen]]) –> deque object

Data:

GRAD_LIST

Mapping from string reference of graduation type to object.

class Graduation[source]

Bases: object

Base Graduation object.

All Graduation objects need to populate PARAMS, COLS, and define an update method.

Attributes:

COLS

list of any data columns that this object should be given.

PARAMS

list of parameters to be defined

Methods:

update(row)

Parameters

:class:`~tables.tableextension.Row` – Trial row

PARAMS = []

list of parameters to be defined

Type

list

COLS = []

list of any data columns that this object should be given.

Type

list

update(row)[source]
Parameters

:class:`~tables.tableextension.Row` – Trial row

class Accuracy(threshold=0.75, window=500, **kwargs)[source]

Bases: autopilot.tasks.graduation.Graduation

Graduate stage based on percent accuracy over some window of trials.

Parameters
  • threshold (float) – Accuracy above this threshold triggers graduation

  • window (int) – number of trials to consider in the past.

  • **kwargs – should have ‘correct’ corresponding to the corrects/incorrects of the past.

Attributes:

COLS

PARAMS

Methods:

update(row)

Get ‘correct’ from the row object.

PARAMS = ['threshold', 'window']
COLS = ['correct']
update(row)[source]

Get ‘correct’ from the row object. If this trial puts us over the threshold, return True, else False.

Parameters

row (Row) – Trial row

Returns

Did we graduate this time or not?

Return type

bool

class NTrials(n_trials, current_trial=0, **kwargs)[source]

Bases: autopilot.tasks.graduation.Graduation

Graduate after doing n trials

Variables

counter (itertools.count) – Counts the trials.

Parameters
  • n_trials (int) – Number of trials to graduate after

  • current_trial (int) – If not starting from zero, start from here

  • **kwargs

Attributes:

PARAMS

Methods:

update(row)

If we’re past n_trials in this trial, return True, else False.

PARAMS = ['n_trials', 'current_trial']
update(row)[source]

If we’re past n_trials in this trial, return True, else False.

Parameters

row – ignored

Returns

Did we graduate or not?

Return type

bool

GRAD_LIST = {'accuracy': <class 'autopilot.tasks.graduation.Accuracy'>, 'n_trials': <class 'autopilot.tasks.graduation.NTrials'>}

Mapping from string reference of graduation type to object.