public abstract class AbstractLinearSGDTrainer<T extends Output<T>,U> extends AbstractSGDTrainer<T,U,AbstractLinearSGDModel<T>,LinearParameters>
It's an AbstractSGDTrainer
operating on LinearParameters
, with
the bias folded into the features.
See:
Bottou L. "Large-Scale Machine Learning with Stochastic Gradient Descent" Proceedings of COMPSTAT, 2010.
addBias, epochs, loggingInterval, minibatchSize, optimiser, rng, seed, shuffle
DEFAULT_SEED
Modifier | Constructor and Description |
---|---|
protected |
AbstractLinearSGDTrainer()
For olcut.
|
protected |
AbstractLinearSGDTrainer(StochasticGradientOptimiser optimiser,
int epochs,
int loggingInterval,
int minibatchSize,
long seed)
Constructs an SGD trainer for a linear model.
|
Modifier and Type | Method and Description |
---|---|
protected LinearParameters |
createParameters(int numFeatures,
int numOutputs,
SplittableRandom localRNG)
Constructs the trainable parameters object, in this case a
LinearParameters containing
a single weight matrix. |
protected String |
getName()
Returns the default model name.
|
createModel, getInvocationCount, getModelClassName, getObjective, getProvenance, getTarget, postConfig, setShuffle, shuffleInPlace, train, train
protected AbstractLinearSGDTrainer(StochasticGradientOptimiser optimiser, int epochs, int loggingInterval, int minibatchSize, long seed)
optimiser
- The gradient optimiser to use.epochs
- The number of epochs (complete passes through the training data).loggingInterval
- Log the loss after this many iterations. If -1 don't log anything.minibatchSize
- The size of any minibatches.seed
- A seed for the random number generator, used to shuffle the examples before each epoch.protected AbstractLinearSGDTrainer()
protected String getName()
getName
in class AbstractSGDTrainer<T extends Output<T>,U,AbstractLinearSGDModel<T extends Output<T>>,LinearParameters>
protected LinearParameters createParameters(int numFeatures, int numOutputs, SplittableRandom localRNG)
LinearParameters
containing
a single weight matrix.createParameters
in class AbstractSGDTrainer<T extends Output<T>,U,AbstractLinearSGDModel<T extends Output<T>>,LinearParameters>
numFeatures
- The number of input features.numOutputs
- The number of output dimensions.localRNG
- The RNG to use for parameter initialisation.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.