com.intel.analytics.bigdl.optim

Optimizer

abstract class Optimizer[T, D] extends AnyRef

Optimizer is an abstract class which is used to train a model automatically with some certain optimization algorithms.

T

numeric type, which can be Float or Double

D

the type of elements in DataSet, such as MiniBatch

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Optimizer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Optimizer(model: Module[T], dataset: DataSet[D], criterion: Criterion[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    model

    the model to be trained

    dataset

    the data set used to train a model

    criterion

    the criterion used to evaluate the loss of the model given an input

Abstract Value Members

  1. abstract def optimize(): Module[T]

    Trigger the optimization process

    Trigger the optimization process

    returns

    the model to be trained

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. var checkSingleton: Boolean

    Attributes
    protected
  8. var checkpointPath: Option[String]

    Attributes
    protected
  9. var checkpointTrigger: Option[Trigger]

    Attributes
    protected
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. var computeThresholdbatchSize: Int

    Attributes
    protected
  12. var criterion: Criterion[T]

    the criterion used to evaluate the loss of the model given an input

    the criterion used to evaluate the loss of the model given an input

    Attributes
    protected
  13. var dataset: DataSet[D]

    the data set used to train a model

    the data set used to train a model

    Attributes
    protected
  14. def disableGradientClipping(): Optimizer.this.type

    Disable gradient clipping

    Disable gradient clipping

    returns

  15. var dropPercentage: Double

    Attributes
    protected
  16. var endWhen: Trigger

    Attributes
    protected
  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def getCheckpointPath(): Option[String]

    Get the directory of saving checkpoint

  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. var isOverWrite: Boolean

    Attributes
    protected
  25. var maxDropPercentage: Double

    Attributes
    protected
  26. var model: Module[T]

    the model to be trained

    the model to be trained

    Attributes
    protected
  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  30. var optimMethods: Map[String, OptimMethod[T]]

    Attributes
    protected
  31. def overWriteCheckpoint(): Optimizer.this.type

    Enable overwrite saving checkpoint

  32. var parameterProcessors: ArrayBuffer[ParameterProcessor]

    a list of ParameterProcessor, orders matter

    a list of ParameterProcessor, orders matter

    Attributes
    protected
  33. def prepareInput(): Unit

  34. def reserveOptim(reserve: Boolean): Optimizer.this.type

  35. def setCheckpoint(path: String, trigger: Trigger): Optimizer.this.type

    Set a check point saved at path triggered by trigger

    Set a check point saved at path triggered by trigger

    path

    the directory to save

    trigger

    how often to save the check point

    returns

    the optimizer

  36. def setConstantGradientClipping(min: Double, max: Double): Optimizer.this.type

    Set constant gradient clipping

    Set constant gradient clipping

    min

    the minimum value to clip by

    max

    the maximum value to clip by

    returns

  37. def setCriterion(newCriterion: Criterion[T]): Optimizer.this.type

    Set a new criterion to the optimizer

    Set a new criterion to the optimizer

    newCriterion

    new criterion

  38. def setDropModuleProperty(dropPercentage: Double, maxDropPercentage: Double, batchsize: Int = 100, warmupIteration: Int = 200): Optimizer.this.type

    Set dropping a certain percentage (dropPercentage) of models during distributed training to accelerate, because some cached model may take too long.

    Set dropping a certain percentage (dropPercentage) of models during distributed training to accelerate, because some cached model may take too long.

    dropPercentage

    drop percentage

    maxDropPercentage

    max drop percentage

    batchsize

    batch size

    warmupIteration

    how may iteration to warm up

    returns

    this optimizer

  39. def setEndWhen(endWhen: Trigger): Optimizer.this.type

    When to stop, passed in a Trigger

    When to stop, passed in a Trigger

    endWhen

    when to end

    returns

    the optimizer

  40. def setGradientClippingByl2Norm(l2NormThreshold: Double): Optimizer.this.type

    Clip gradient to a maximum L2-norm

    Clip gradient to a maximum L2-norm

    l2NormThreshold

    gradient L2-Norm threshold

    returns

  41. def setModel(newModel: Module[T]): Optimizer.this.type

    Set a model to the optimizer.

    Set a model to the optimizer. Notice: if current optimMethod in this optimizer is not a global optimMethod, this setModel will throw an exception. You should use setModelAndOptimMethods instead.

    newModel

    new model

  42. def setModelAndOptimMethods(newModel: Module[T], newOptimMethods: Map[String, OptimMethod[T]]): Optimizer.this.type

    Set new model and new optimMethods to the optimizer.

    Set new model and new optimMethods to the optimizer.

    newModel

    new model

    newOptimMethods

    new optimMethods

  43. def setOptimMethod(method: OptimMethod[T]): Optimizer.this.type

    Set an optimization method

    Set an optimization method

    method

    optimization method

  44. def setOptimMethods(method: Map[String, OptimMethod[T]]): Optimizer.this.type

    Set optimization methods for each submodule.

    Set optimization methods for each submodule.

    method

    A mapping of submodule -> OptimMethod

  45. def setState(state: Table): Optimizer.this.type

    Set a state(learning rate, epochs.

    Set a state(learning rate, epochs...) to the optimizer

    state

    the state to be saved

  46. def setTrainData(sampleRDD: RDD[Sample[T]], batchSize: Int, featurePaddingParam: PaddingParam[T] = null, labelPaddingParam: PaddingParam[T] = null): Optimizer.this.type

    Set new train dataset.

    Set new train dataset.

    sampleRDD

    training Samples

    batchSize

    mini batch size

    featurePaddingParam

    feature padding strategy, see com.intel.analytics.bigdl.dataset.PaddingParam for details.

    labelPaddingParam

    label padding strategy, see com.intel.analytics.bigdl.dataset.PaddingParam for details.

    returns

    the optimizer

  47. def setTrainData(sampleRDD: RDD[Sample[T]], batchSize: Int, miniBatchImpl: MiniBatch[T]): Optimizer.this.type

    Set new train dataset.

    Set new train dataset. User can supply a customized implementation of trait MiniBatch to define how data is organized and retrieved in a mini batch.

    sampleRDD

    training Samples

    batchSize

    mini batch size

    miniBatchImpl

    An User-Defined MiniBatch implementation.

    returns

    the Optimizer

  48. def setTrainSummary(trainSummary: TrainSummary): Optimizer.this.type

    Enable train summary.

  49. def setValidation(trigger: Trigger, sampleRDD: RDD[Sample[T]], vMethods: Array[ValidationMethod[T]], batchSize: Int, miniBatch: MiniBatch[T]): Optimizer.this.type

    Set validate evaluation

    Set validate evaluation

    trigger

    how often to evaluation validation set

    sampleRDD

    validate data set in type of RDD of Sample

    vMethods

    a set of validation method ValidationMethod

    batchSize

    batch size

    miniBatch

    construct MiniBatch with a specified miniBatch type

    returns

  50. def setValidation(trigger: Trigger, sampleRDD: RDD[Sample[T]], vMethods: Array[ValidationMethod[T]], batchSize: Int): Optimizer.this.type

    Set a validate evaluation

    Set a validate evaluation

    trigger

    how often to evaluation validation set

    sampleRDD

    validate data set in type of RDD of Sample

    vMethods

    a set of validation method ValidationMethod

    batchSize

    batch size

    returns

    this optimizer

  51. def setValidation(trigger: Trigger, sampleRDD: RDD[Sample[T]], vMethods: Array[ValidationMethod[T]], batchSize: Int, featurePaddingParam: PaddingParam[T], labelPaddingParam: PaddingParam[T]): Optimizer.this.type

    Set a validate evaluation

    Set a validate evaluation

    trigger

    how often to evaluation validation set

    sampleRDD

    validate data set in type of RDD of Sample

    vMethods

    a set of validation method ValidationMethod

    batchSize

    batch size

    featurePaddingParam

    feature padding strategy, see com.intel.analytics.bigdl.dataset.PaddingParam for details.

    labelPaddingParam

    label padding strategy, see com.intel.analytics.bigdl.dataset.PaddingParam for details.

    returns

    this optimizer

  52. def setValidation(trigger: Trigger, dataset: DataSet[MiniBatch[T]], vMethods: Array[ValidationMethod[T]]): Optimizer.this.type

    Set a validate evaluation

    Set a validate evaluation

    trigger

    how often to evaluation validation set

    dataset

    validate data set in type of DataSet of MiniBatch

    vMethods

    a set of validation method ValidationMethod

    returns

    this optimizer

  53. def setValidationSummary(validationSummary: ValidationSummary): Optimizer.this.type

    Enable validation summary.

  54. var state: Table

    Attributes
    protected
  55. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  56. def toString(): String

    Definition Classes
    AnyRef → Any
  57. var trainSummary: Option[TrainSummary]

    Attributes
    protected
  58. var validationDataSet: Option[DataSet[MiniBatch[T]]]

    Attributes
    protected
  59. var validationMethods: Option[Array[ValidationMethod[T]]]

    Attributes
    protected
  60. var validationSummary: Option[ValidationSummary]

    Attributes
    protected
  61. var validationTrigger: Option[Trigger]

    Attributes
    protected
  62. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. var warmupIterationNum: Int

    Attributes
    protected

Deprecated Value Members

  1. def disableCheckSingleton(): Optimizer.this.type

    make optimizer not check the singleton model on a node

    make optimizer not check the singleton model on a node

    returns

    Annotations
    @deprecated
    Deprecated

    (Since version 0.1.0) Use bigdl.check.singleton instead

Inherited from AnyRef

Inherited from Any

Ungrouped