public class PerceptronTrainer extends AbstractEventTrainer
Modifier and Type | Field and Description |
---|---|
static String |
PERCEPTRON_VALUE |
static double |
TOLERANCE_DEFAULT |
DATA_INDEXER_ONE_PASS_REAL_VALUE, 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, VERBOSE_DEFAULT, VERBOSE_PARAM
EVENT_VALUE
Constructor and Description |
---|
PerceptronTrainer() |
PerceptronTrainer(TrainingParameters parameters) |
Modifier and Type | Method and Description |
---|---|
AbstractModel |
doTrain(DataIndexer indexer) |
boolean |
isSortAndMerge() |
boolean |
isValid()
Deprecated.
|
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) |
void |
validate()
Check parameters.
|
getDataIndexer, train, train
getAlgorithm, getCutoff, getIterations, init, init
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, init
public static final String PERCEPTRON_VALUE
public static final double TOLERANCE_DEFAULT
public PerceptronTrainer()
public PerceptronTrainer(TrainingParameters parameters)
public void validate()
AbstractTrainer
validate
in class AbstractEventTrainer
@Deprecated public boolean isValid()
isValid
in class AbstractEventTrainer
public boolean isSortAndMerge()
isSortAndMerge
in class AbstractEventTrainer
public AbstractModel doTrain(DataIndexer indexer) throws IOException
doTrain
in class AbstractEventTrainer
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 © 2021 The Apache Software Foundation. All rights reserved.