public class PerceptronTrainer extends Object
Modifier and Type | Field and Description |
---|---|
static double |
TOLERANCE_DEFAULT |
Constructor and Description |
---|
PerceptronTrainer() |
Modifier and Type | Method and Description |
---|---|
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) |
public static final double TOLERANCE_DEFAULT
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 © 2018 The Apache Software Foundation. All rights reserved.