public class PerceptronTrainer extends AbstractEventTrainer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PERCEPTRON_VALUE |
static double |
TOLERANCE_DEFAULT |
DATA_INDEXER_ONE_PASS_VALUE, DATA_INDEXER_PARAM, DATA_INDEXER_TWO_PASS_VALUE
ALGORITHM_PARAM, CUTOFF_DEFAULT, CUTOFF_PARAM, ITERATIONS_DEFAULT, ITERATIONS_PARAM, TRAINER_TYPE_PARAM
EVENT_VALUE
Constructor and Description |
---|
PerceptronTrainer() |
Modifier and Type | Method and Description |
---|---|
AbstractModel |
doTrain(DataIndexer indexer) |
boolean |
isSortAndMerge() |
boolean |
isValid() |
void |
setSkippedAveraging(boolean averaging)
Enables skipped averaging, this flag changes the standard
averaging to special averaging instead.
|
void |
setStepSizeDecrease(double decrease)
Enables and sets step size decrease.
|
void |
setTolerance(double tolerance)
Specifies the tolerance.
|
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff) |
AbstractModel |
trainModel(int iterations,
DataIndexer di,
int cutoff,
boolean useAverage) |
getDataIndexer, train
getAlgorithm, getCutoff, getIterations, init
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public static final java.lang.String PERCEPTRON_VALUE
public static final double TOLERANCE_DEFAULT
public boolean isValid()
isValid
in class AbstractEventTrainer
public boolean isSortAndMerge()
isSortAndMerge
in class AbstractEventTrainer
public AbstractModel doTrain(DataIndexer indexer) throws java.io.IOException
doTrain
in class AbstractEventTrainer
java.io.IOException
public void setTolerance(double tolerance)
tolerance
- public void setStepSizeDecrease(double decrease)
decrease
- - step size decrease in percentpublic void setSkippedAveraging(boolean averaging)
If we are doing averaging, and the current iteration is one of the first 20 or it is a perfect square, then updated the summed parameters.
The reason we don't take all of them is that the parameters change less toward the end of training, so they drown out the contributions of the more volatile early iterations. The use of perfect squares allows us to sample from successively farther apart iterations.
averaging
- averaging flagpublic AbstractModel trainModel(int iterations, DataIndexer di, int cutoff)
public AbstractModel trainModel(int iterations, DataIndexer di, int cutoff, boolean useAverage)
Copyright © 2010 - 2020 Adobe. All Rights Reserved