Too much of what is called ‘education’ is little more than an expensive isolation from reality.
—Thomas Sowell
How it Works¶
Files¶
The spaced
algorithm is made up of five different packages/files:
repetition.py
- learning tracker featuresgraph.py
- provides graphing featuresanimate.py
- provides ffmpeg video featurespid.py
- provides a proportional-integral-differential controllercli.py
- wrapper for the pytest package
The repetition
package contains the majority of the scheduling code. It’s
class structure is primarily broken into the SpaceRepetitionReference
, the
SpaceRepetitionFeedback
and the SpaceRepetitionControl
classes.
The common features and interface shared by they classes come from them inheriting from the
SpaceRepetition
class.
SpaceRepetitionReference¶
The SpaceRepetitionReference
is
used to construct the system goals. It sets up the initial forgetting curves
and the reference plasticity curve. This is done using an exponential decay to
create a set of less and less aggressive exponential decay curves. The nature
of these curves can be tuned using the fdecay0
and fdecaytau
input
parameters.
The stickleback looking part of the reference graph, which can be seen below, is made by restarting an exponential decay at the intersection of the forgetting curve and the reference plasticity curve.
The reference plasticity curve, represented by the dark blue line above, is a ratio of two different exponential functions:
# x**(1.0/plasticity_root)
# r = ---------------------------------------------------------
# (x+plasticity_denominator_offset)**(1.0/plasticity_root)
The plasticity curve can be tuned using the plasticity_root
and the
plasticity_denominator_offset
parameters.
The part of the algorithm that generates the forgetting curves is held within a coroutine. This is done so that infinite schedules can be generated from any SpaceRepetitionReference object. A SpaceRepetitionReference object has a finite computer-memory requirement, meaning that you can scale up a system without worrying about computer-memory leaks; it’s computer-memory requirement will grow linearly with the number of objects that you create.
SpaceRepetitionFeedback¶
The SpaceRepetitionFeedback
class
is used for accepting student feedback and generating the new
observed-plasticity curve. This curve is built using the scipy.optimize
curve_fit
api. It tries to find the plasticity_root
and
plasticity_denominator_offset
parameters that draw a line that has the same
shape of the reference plasticity curve but fits the feedback data provided by
the student. When fitting this curve it places an emphasis on the most recently
observed data.
SpaceRepetitionController¶
The SpaceRepetitionController
class generates an error signal by subtracting
the reference plasticity curve from the observed plasticity curve. Then it
feeds this error signal into two PID controllers to change the reference
forgetting curve parameters, fdecay0
and fdecaytau
, to look more like
those generated from the student’s feedback. To read about how to change these
control parameters look here.
The SpaceRepetitionController
class then finds the intersection between the
reference plasticity curve and the observed plasticity curve providing a
starting point to place a new reference plasticity curve and a new set of
forgetting curves riding on its back.
LearningTracker¶
The LearningTracker
class aggregates the reference, feedback and control
features into one easy-to-use class. Any tuning parameter that can be fed into
any of the other classes can be fed into it, and it will ensure that this
parameter is passed on properly.
The majority of the features offered by the LearningTracker
are described in
the recipes section.