org.apache.ignite.ml.optimization.updatecalculators

## Class SimpleGDUpdateCalculator

- java.lang.Object
- - org.apache.ignite.ml.optimization.updatecalculators.SimpleGDUpdateCalculator

- All Implemented Interfaces:
    Serializable, ParameterUpdateCalculator<SmoothParametrized,SimpleGDParameterUpdate>

      public class SimpleGDUpdateCalculator
      extends Object
      implements ParameterUpdateCalculator<SmoothParametrized,SimpleGDParameterUpdate>

  Simple gradient descent parameters updater.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IgniteFunction<Vector,IgniteDifferentiableVectorToDoubleFunction>` | `loss` Loss function.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleGDUpdateCalculator()` Construct instance of this class with default parameters.
    `SimpleGDUpdateCalculator(double learningRate)` Construct SimpleGDUpdateCalculator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleGDParameterUpdate` | `calculateNewUpdate(SmoothParametrized mlp, SimpleGDParameterUpdate updaterParameters, int iteration, Matrix inputs, Matrix groundTruth)` Calculate new update.
    `SimpleGDParameterUpdate` | `init(SmoothParametrized mdl, IgniteFunction<Vector,IgniteDifferentiableVectorToDoubleFunction> loss)` Initializes the update calculator.
    `<M1 extends SmoothParametrized> M1` | `update(M1 obj, SimpleGDParameterUpdate update)` Update given obj with this parameters.
    `SimpleGDUpdateCalculator` | `withLearningRate(double learningRate)` Create new instance of this class with same parameters as this one, but with new learning rate.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### loss

          protected IgniteFunction<Vector,IgniteDifferentiableVectorToDoubleFunction> loss

      Loss function.

  - ### Constructor Detail

    - #### SimpleGDUpdateCalculator

          public SimpleGDUpdateCalculator()

      Construct instance of this class with default parameters.

    - #### SimpleGDUpdateCalculator

          public SimpleGDUpdateCalculator(double learningRate)

      Construct SimpleGDUpdateCalculator.
      Parameters:
        `learningRate` - Learning rate.

  - ### Method Detail

    - #### init

          public SimpleGDParameterUpdate init(SmoothParametrized mdl,
                                              IgniteFunction<Vector,IgniteDifferentiableVectorToDoubleFunction> loss)

      Initializes the update calculator.
      Specified by:
        `init` in interface `ParameterUpdateCalculator<SmoothParametrized,SimpleGDParameterUpdate>`
      Parameters:
        `mdl` - Model to be trained.
        `loss` - Loss function.
      Returns:
        Initialized parameters.

    - #### calculateNewUpdate

          public SimpleGDParameterUpdate calculateNewUpdate(SmoothParametrized mlp,
                                                            SimpleGDParameterUpdate updaterParameters,
                                                            int iteration,
                                                            Matrix inputs,
                                                            Matrix groundTruth)

      Calculate new update.
      Specified by:
        `calculateNewUpdate` in interface `ParameterUpdateCalculator<SmoothParametrized,SimpleGDParameterUpdate>`
      Parameters:
        `mlp` - Model to be updated.
        `updaterParameters` - Updater parameters to updateCache.
        `iteration` - Current trainer iteration.
        `inputs` - Inputs.
        `groundTruth` - True values.
      Returns:
        Updated parameters.

    - #### update

          public <M1 extends SmoothParametrized> M1 update(M1 obj,
                                                           SimpleGDParameterUpdate update)

      Update given obj with this parameters.
      Specified by:
        `update` in interface `ParameterUpdateCalculator<SmoothParametrized,SimpleGDParameterUpdate>`
      Parameters:
        `obj` - Object to be updated.

    - #### withLearningRate

          public SimpleGDUpdateCalculator withLearningRate(double learningRate)

      Create new instance of this class with same parameters as this one, but with new learning rate.
      Parameters:
        `learningRate` - Learning rate.
      Returns:
        New instance of this class with same parameters as this one, but with new learning rate.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020