These propagate Batches sampled from a DataSet using a Sampler through a Module in order to evaluate a Loss, provide Feedback or train the model :


Abstract Class for propagating a sampling distribution (a Sampler) through a Module. A Propagator can be sub-classed to build task-tailored training or evaluation algorithms.


A Propagator constructor which takes key-value arguments:

  • loss is a Criterion which the Model output will need to evaluate or minimize.
  • callback is a user-defined function(model, report) that does things like update the model parameters, gather statistics, decay learning rate, etc.
  • epoch_callback is a user-defined function(model, report) that is called between epochs. Typically used for learning rate decay and such;
  • sampler is, you guessed it, a Sampler instance which iterates through a DataSet. Defaults to dp.Sampler()
  • observer is an Observer instance that is informed when an event occurs.
  • feedback is a Feedback instance that takes Model input, output and targets as input to provide I/O feedback to the user or system.
  • progress is a boolean that, when true, displays the progress of examples seen in the epoch. Defaults to false.
  • stats is a boolean for displaying statistics. Defaults to false.


Optimizes a Module on a train DataSet.


Evaluates a Model on a valid or test DataSet.