public class NoRegularization$ extends Object implements RegularizationPenalty
Modifier and Type | Field and Description |
---|---|
static NoRegularization$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
NoRegularization$() |
Modifier and Type | Method and Description |
---|---|
double |
regLoss(double oldLoss,
Vector weightVector,
double regularizationParameter)
Returns the unmodified loss value
|
Vector |
takeStep(Vector weightVector,
Vector gradient,
double regularizationConstant,
double learningRate)
Calculates the new weights based on the gradient
|
public static final NoRegularization$ MODULE$
public Vector takeStep(Vector weightVector, Vector gradient, double regularizationConstant, double learningRate)
The updated weight is w - learningRate *gradient
where w
is the weight vector
takeStep
in interface RegularizationPenalty
weightVector
- The weights to be updatedgradient
- The gradient according to which we will update the weightsregularizationConstant
- The regularization parameter which is ignoredlearningRate
- The effective step size for this iterationpublic double regLoss(double oldLoss, Vector weightVector, double regularizationParameter)
The updated loss is oldLoss
regLoss
in interface RegularizationPenalty
oldLoss
- The loss to be updatedweightVector
- The weights used to update the lossregularizationParameter
- The regularization parameter which is ignoredCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.