public abstract class AbstractMinimizingOnlineLearner<M extends Model> extends AbstractOnlineLearner<M>
| Modifier and Type | Field and Description |
|---|---|
protected StochasticMinimizer |
minimizer |
protected int |
numPasses |
protected Random |
random |
protected boolean |
sparseWeights |
featureDimension, numOutcomeClasses, outcomeDimension, streamSupplier, verbose| Constructor and Description |
|---|
AbstractMinimizingOnlineLearner(StochasticMinimizer minimizer) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract M |
createModel(de.jungblut.math.DoubleVector weights)
Creates a model with the given minimized weights.
|
protected abstract de.jungblut.math.minimize.CostGradientTuple |
observeExample(de.jungblut.online.ml.FeatureOutcomePair next,
de.jungblut.math.DoubleVector weights)
Observes the next example.
|
protected de.jungblut.math.minimize.CostGradientTuple |
observeExampleSafe(de.jungblut.online.ml.FeatureOutcomePair next,
de.jungblut.math.DoubleVector weights) |
protected de.jungblut.math.DoubleVector |
randomInitialize(int dimension) |
void |
setNumPasses(int passes) |
void |
setRandom(Random random) |
M |
train(java.util.function.Supplier<java.util.stream.Stream<de.jungblut.online.ml.FeatureOutcomePair>> streamSupplier)
Trains a new model using the supplied streams.
|
void |
useSparseWeights() |
init, peekDimensions, setVerbose, verboseprotected final StochasticMinimizer minimizer
protected Random random
protected int numPasses
protected boolean sparseWeights
public AbstractMinimizingOnlineLearner(StochasticMinimizer minimizer)
public M train(java.util.function.Supplier<java.util.stream.Stream<de.jungblut.online.ml.FeatureOutcomePair>> streamSupplier)
OnlineLearnerstreamSupplier - the supplier that creates a new stream that can be
consumed.protected abstract de.jungblut.math.minimize.CostGradientTuple observeExample(de.jungblut.online.ml.FeatureOutcomePair next,
de.jungblut.math.DoubleVector weights)
next - the next feature/outcome pair.weights - the current weights.protected abstract M createModel(de.jungblut.math.DoubleVector weights)
weights - the learned weights.protected de.jungblut.math.minimize.CostGradientTuple observeExampleSafe(de.jungblut.online.ml.FeatureOutcomePair next,
de.jungblut.math.DoubleVector weights)
protected de.jungblut.math.DoubleVector randomInitialize(int dimension)
public void setRandom(Random random)
public void useSparseWeights()
public void setNumPasses(int passes)
Copyright © 2015. All rights reserved.