|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclarion.tools.TrainableImplicitModulePreTrainer
public class TrainableImplicitModulePreTrainer
This class implements a pre-trainer that can be used on trainable implicit modules in CLARION.
Usage:
The pre-trainer is a tool for training implicit modules that are trainable (i.e. they extend from AbstractTrainableImplicitModule). Any class which extends the AbstractTriainableImplicitModule class can be trained by this pre-trainer.
This class is called a PRE-trainer because it is intended to be used "offline" BEFORE the start of a task (i.e. during initialization).
If the implicit module you wish to train is a "runtime trainable" implicit module (i.e. it extends from AbstractRuntimeTrainableImplicitModule), it will be trained in an "online" fashion. That is, at each time step, the "runtime trainable" implicit module you are training will stochastically choose an output, receive feedback, and learn based on the feedback.
Below are the things that need to be provided in order to use this pre-trainer:
There are three possible termination conditions for training
(as determined by the TERMINATION_CONDITION constant):
This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.
Nested Class Summary | |
---|---|
private class |
TrainableImplicitModulePreTrainer.SumSquaredErrorTracker
This class implements a sum of squared error tracker. |
static class |
TrainableImplicitModulePreTrainer.TerminationConditions
The termination condition options |
Field Summary | |
---|---|
static int |
GLOBAL_NUM_TRAINING_REPEATS
The number of times to run through the training set before ending training. |
static boolean |
GLOBAL_PRINT_PROGRESS_TO_SYSTEM_OUT
Option for printing out the progress of training (false by default) |
static double |
GLOBAL_SUM_SQ_ERRORS_THRESHOLD
The threshold the sum of squared errors must meet before training can end. |
static TrainableImplicitModulePreTrainer.TerminationConditions |
GLOBAL_TERMINATION_CONDITION
The method of determining the termination condition(s) when training BPNets. |
int |
NUM_TRAINING_REPEATS
The number of times to run through the training set before ending training. |
boolean |
PRINT_PROGRESS_TO_SYSTEM_OUT
Option for printing out the progress of training (false by default) |
StochasticSelector |
SELECTOR
The stochastic selector to use if the target module to be trained is runtime trainable. |
double |
SUM_SQ_ERRORS_THRESHOLD
The threshold the sum of squared errors must meet before training can end. |
TrainableImplicitModulePreTrainer.TerminationConditions |
TERMINATION_CONDITION
The method of determining the termination condition(s) when training BPNets. |
Constructor Summary | |
---|---|
TrainableImplicitModulePreTrainer()
|
Method Summary | |
---|---|
private void |
dataRecursor(AbstractTrainableImplicitModule target,
AbstractImplicitModule trainer,
java.util.ListIterator<Dimension> dim,
java.util.ListIterator<? extends Value> val,
TrainableImplicitModulePreTrainer.SumSquaredErrorTracker sqe)
Recursive method that iterates over the dimensions of a dimension-value collection (from the data set and trains the specified target implicit module based on the outputs from the specified trainer implicit module. |
private void |
innerLoop(AbstractTrainableImplicitModule target,
AbstractImplicitModule trainer,
java.util.ListIterator<Dimension> dim,
java.util.ListIterator<? extends Value> val,
Dimension d,
Value v,
TrainableImplicitModulePreTrainer.SumSquaredErrorTracker sqe)
The inner loop of the dataRecursor method. |
void |
trainModule(AbstractTrainableImplicitModule target,
AbstractImplicitModule trainer,
java.util.Collection<? extends DimensionValueCollection> data)
Trains the specified target implicit module using the specified training implicit module over the specified data set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int GLOBAL_NUM_TRAINING_REPEATS
public static double GLOBAL_SUM_SQ_ERRORS_THRESHOLD
public static TrainableImplicitModulePreTrainer.TerminationConditions GLOBAL_TERMINATION_CONDITION
public int NUM_TRAINING_REPEATS
public double SUM_SQ_ERRORS_THRESHOLD
public TrainableImplicitModulePreTrainer.TerminationConditions TERMINATION_CONDITION
public static boolean GLOBAL_PRINT_PROGRESS_TO_SYSTEM_OUT
public boolean PRINT_PROGRESS_TO_SYSTEM_OUT
public StochasticSelector SELECTOR
Constructor Detail |
---|
public TrainableImplicitModulePreTrainer()
Method Detail |
---|
public void trainModule(AbstractTrainableImplicitModule target, AbstractImplicitModule trainer, java.util.Collection<? extends DimensionValueCollection> data)
target
- The target implicit module to train.trainer
- The implicit module to use as the trainer.data
- The data set over which to train the target module.private void dataRecursor(AbstractTrainableImplicitModule target, AbstractImplicitModule trainer, java.util.ListIterator<Dimension> dim, java.util.ListIterator<? extends Value> val, TrainableImplicitModulePreTrainer.SumSquaredErrorTracker sqe)
target
- The target implicit module to be trained.trainer
- The implicit module to be used as the trainer.dim
- A list iterator for the dimensions.val
- A list iterator for the values within the dimension currently being addressed.sqe
- The sum of squared error tracker being used to track the sum of squared error.private void innerLoop(AbstractTrainableImplicitModule target, AbstractImplicitModule trainer, java.util.ListIterator<Dimension> dim, java.util.ListIterator<? extends Value> val, Dimension d, Value v, TrainableImplicitModulePreTrainer.SumSquaredErrorTracker sqe)
target
- The target implicit module to be trained.trainer
- The implicit module to be used as the trainer.dim
- A list iterator for the dimensions.val
- A list iterator for the values within the dimension currently being addressed.d
- The dimension currently being addressed.v
- The value currently being addressed.sqe
- The sum of squared error tracker being used to track the sum of squared error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |