Class SimpleUpdater
Object
org.apache.spark.mllib.optimization.Updater
org.apache.spark.mllib.optimization.SimpleUpdater
- All Implemented Interfaces:
Serializable
,scala.Serializable
A simple updater for gradient descent *without* any regularization.
Uses a step-size decreasing with the square root of the number of iterations.
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SimpleUpdater
public SimpleUpdater()
-
-
Method Details
-
compute
public scala.Tuple2<Vector,Object> compute(Vector weightsOld, Vector gradient, double stepSize, int iter, double regParam) Description copied from class:Updater
Compute an updated value for weights given the gradient, stepSize, iteration number and regularization parameter. Also returns the regularization value regParam * R(w) computed using the *updated* weights.- Specified by:
compute
in classUpdater
- Parameters:
weightsOld
- - Column matrix of size dx1 where d is the number of features.gradient
- - Column matrix of size dx1 where d is the number of features.stepSize
- - step size across iterationsiter
- - Iteration numberregParam
- - Regularization parameter- Returns:
- A tuple of 2 elements. The first element is a column matrix containing updated weights, and the second element is the regularization value computed using updated weights.
-