Class/Object

com.intel.analytics.bigdl.optim

Optimizer

Related Docs: object Optimizer | package optim

Permalink

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
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])

    Permalink

    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]

    Permalink

    Trigger the optimization process

    Trigger the optimization process

    returns

    the model to be trained

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. var checkSingleton: Boolean

    Permalink
    Attributes
    protected
  6. var checkpointPath: Option[String]

    Permalink
    Attributes
    protected
  7. var checkpointTrigger: Option[Trigger]

    Permalink
    Attributes
    protected
  8. def clone(): AnyRef

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

    Permalink
    Attributes
    protected
  10. var criterion: Criterion[T]

    Permalink

    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
  11. var dataset: DataSet[D]

    Permalink

    the data set used to train a model

    the data set used to train a model

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

    Permalink

    Disable gradient clipping

  13. var dropPercentage: Double

    Permalink
    Attributes
    protected
  14. var endWhen: Trigger

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

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

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

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

    Permalink

    Get the directory of saving checkpoint

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

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

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

    Permalink
    Definition Classes
    Any
  22. var isOverWrite: Boolean

    Permalink
    Attributes
    protected
  23. var maxDropPercentage: Double

    Permalink
    Attributes
    protected
  24. var model: Module[T]

    Permalink

    the model to be trained

    the model to be trained

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

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

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

    Permalink
    Attributes
    protected
  29. def overWriteCheckpoint(): Optimizer.this.type

    Permalink

    Enable overwrite saving checkpoint

  30. var parameterProcessors: ArrayBuffer[ParameterProcessor]

    Permalink

    a list of ParameterProcessor, orders matter

    a list of ParameterProcessor, orders matter

    Attributes
    protected
  31. def prepareInput(): Unit

    Permalink
  32. def reserveOptim(reserve: Boolean): Optimizer.this.type

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

    Permalink

    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

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

    Permalink

    Set constant gradient clipping

    Set constant gradient clipping

    min

    the minimum value to clip by

    max

    the maximum value to clip by

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

    Permalink

    Set a new criterion to the optimizer

    Set a new criterion to the optimizer

    newCriterion

    new criterion

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

    Permalink

    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

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

    Permalink

    When to stop, passed in a Trigger

    When to stop, passed in a Trigger

    endWhen

    when to end

    returns

    the optimizer

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

    Permalink

    Clip gradient to a maximum L2-norm

    Clip gradient to a maximum L2-norm

    l2NormThreshold

    gradient L2-Norm threshold

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

    Permalink

    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

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

    Permalink

    Set new model and new optimMethods to the optimizer.

    Set new model and new optimMethods to the optimizer.

    newModel

    new model

    newOptimMethods

    new optimMethods

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

    Permalink

    Set an optimization method

    Set an optimization method

    method

    optimization method

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

    Permalink

    Set optimization methods for each submodule.

    Set optimization methods for each submodule.

    method

    A mapping of submodule -> OptimMethod

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

    Permalink

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

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

    state

    the state to be saved

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    Enable train summary.

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    Enable validation summary.

  52. var state: Table

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

    Permalink
    Definition Classes
    AnyRef
  54. def toString(): String

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

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

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

    Permalink
    Attributes
    protected
  58. var validationSummary: Option[ValidationSummary]

    Permalink
    Attributes
    protected
  59. var validationTrigger: Option[Trigger]

    Permalink
    Attributes
    protected
  60. final def wait(): Unit

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

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

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

    Permalink
    Attributes
    protected

Deprecated Value Members

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

    Permalink

    make optimizer not check the singleton model on a node

    make optimizer not check the singleton model on a node

    Annotations
    @deprecated
    Deprecated

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

Inherited from AnyRef

Inherited from Any

Ungrouped