Package samer.models
Class SparseICA.ON3Trainer
- java.lang.Object
-
- samer.tools.AnonymousTask
-
- samer.models.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 updatevoid
accumulate(double w)
weighted accumulatevoid
dispose()
void
flush()
use collected stats to update parameters and resetSparseMatrix
getGMatrix()
this is so you can manipulate the matrix before flushingvoid
oneshot()
Must be equivalent to reset(); accumulate(); flush(); but can be optimised for non-batched trainingvoid
reset()
reset accumulators without updating parametersvoid
run()
void
starting()
-
Methods inherited from class samer.tools.AnonymousTask
stopping
-
-
-
-
Method Detail
-
getGMatrix
public SparseMatrix getGMatrix()
this is so you can manipulate the matrix before flushing
-
starting
public void starting()
- Specified by:
starting
in interfaceTask
- Overrides:
starting
in classAnonymousTask
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceModel.Trainer
- Specified by:
dispose
in interfaceTask
- Overrides:
dispose
in classAnonymousTask
-
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 interfaceModel.Trainer
-
reset
public void reset()
Description copied from interface:Model.Trainer
reset accumulators without updating parameters- Specified by:
reset
in interfaceModel.Trainer
-
accumulate
public void accumulate()
Description copied from interface:Model.Trainer
collect statistics for parameter update- Specified by:
accumulate
in interfaceModel.Trainer
-
accumulate
public void accumulate(double w)
Description copied from interface:Model.Trainer
weighted accumulate- Specified by:
accumulate
in interfaceModel.Trainer
-
flush
public void flush()
Description copied from interface:Model.Trainer
use collected stats to update parameters and reset- Specified by:
flush
in interfaceModel.Trainer
-
-