Package samer.models

Class SparseICA.ON3Trainer

  • All Implemented Interfaces:
    Model.Trainer, Task
    Enclosing class:
    SparseICA


    public class SparseICA.ON3Trainer
    extends AnonymousTask
    implements Model.Trainer
    This trainer saves on an O(N^2) step during accumulation, at the expense of an O(N^3) flush. As long as the batch size is O(N), then it should be about the same overall. The advantage is the collected statistics are more transparent, and can be used to make scalar or diagonal updates more frequenty.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ON3Trainer() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void accumulate()
      collect statistics for parameter update
      void accumulate(double w)
      weighted accumulate
      void dispose() 
      void flush()
      use collected stats to update parameters and reset
      SparseMatrix getGMatrix()
      this is so you can manipulate the matrix before flushing
      void oneshot()
      Must be equivalent to reset(); accumulate(); flush(); but can be optimised for non-batched training
      void reset()
      reset accumulators without updating parameters
      void run() 
      void starting() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ON3Trainer

        public ON3Trainer()
    • Method Detail

      • getGMatrix

        public SparseMatrix getGMatrix()
        this is so you can manipulate the matrix before flushing
      • run

        public void run()
        Specified by:
        run in interface Task
      • oneshot

        public void oneshot()
        Description copied from interface: Model.Trainer
        Must be equivalent to reset(); accumulate(); flush(); but can be optimised for non-batched training
        Specified by:
        oneshot in interface Model.Trainer
      • reset

        public void reset()
        Description copied from interface: Model.Trainer
        reset accumulators without updating parameters
        Specified by:
        reset in interface Model.Trainer
      • accumulate

        public void accumulate()
        Description copied from interface: Model.Trainer
        collect statistics for parameter update
        Specified by:
        accumulate in interface Model.Trainer
      • flush

        public void flush()
        Description copied from interface: Model.Trainer
        use collected stats to update parameters and reset
        Specified by:
        flush in interface Model.Trainer