Class/Object

com.intel.analytics.zoo.pipeline.nnframes

NNEstimator

Related Docs: object NNEstimator | package nnframes

Permalink

class NNEstimator[T] extends DLEstimatorBase[NNEstimator[T], NNModel[T]] with NNParams[T] with TrainingParams[T]

NNEstimator extends org.apache.spark.ml.Estimator and supports training a BigDL model with Spark DataFrame data. It can be integrated into a standard Spark ML Pipeline to allow users combine the components of BigDL and Spark MLlib.

NNEstimator supports different feature and label data type through Preprocessing. We provide pre-defined Preprocessing for popular data types like Array or Vector in package com.intel.analytics.zoo.feature, while user can also develop customized Preprocessing. During fit, NNEstimator will extract feature and label data from input DataFrame and use the Preprocessing to prepare data for the model. Using the Preprocessing allows NNEstimator to cache only the raw data and decrease the memory consumption during feature conversion and training. More concrete examples are available in package com.intel.analytics.zoo.examples.nnframes

T

data type of BigDL Model

Linear Supertypes
TrainingParams[T], NNParams[T], VectorCompatibility, HasBatchSize, HasPredictionCol, HasPredictionCol, HasFeaturesCol, HasFeaturesCol, DLEstimatorBase[NNEstimator[T], NNModel[T]], HasLabelCol, Estimator[NNModel[T]], PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NNEstimator
  2. TrainingParams
  3. NNParams
  4. VectorCompatibility
  5. HasBatchSize
  6. HasPredictionCol
  7. HasPredictionCol
  8. HasFeaturesCol
  9. HasFeaturesCol
  10. DLEstimatorBase
  11. HasLabelCol
  12. Estimator
  13. PipelineStage
  14. Logging
  15. Params
  16. Serializable
  17. Serializable
  18. Identifiable
  19. AnyRef
  20. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 $[T](param: Param[T]): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  4. final def ==(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    Any
  6. final val batchSize: IntParam

    Permalink

    Global batch size across the cluster.

    Global batch size across the cluster.

    Definition Classes
    HasBatchSize
  7. final val cachingSample: BooleanParam

    Permalink

    whether to cache the Samples after preprocessing.

    whether to cache the Samples after preprocessing. Default: true

    Definition Classes
    TrainingParams
  8. final val checkpointOverwrite: BooleanParam

    Permalink
    Definition Classes
    TrainingParams
  9. final val checkpointPath: Param[String]

    Permalink

    Set a check point saved at path triggered by trigger Default: not enabled

    Set a check point saved at path triggered by trigger Default: not enabled

    Definition Classes
    TrainingParams
  10. final val checkpointTrigger: Param[Trigger]

    Permalink
    Definition Classes
    TrainingParams
  11. final def clear(param: Param[_]): NNEstimator.this.type

    Permalink
    Definition Classes
    Params
  12. def clearGradientClipping(): NNEstimator.this.type

    Permalink

    Clear clipping params, in this case, clipping will not be applied.

  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. final val constantGradientClippingParams: Param[(Float, Float)]

    Permalink

    Constant gradient clipping thresholds.

    Constant gradient clipping thresholds.

    Definition Classes
    TrainingParams
  15. def copy(extra: ParamMap): NNEstimator[T]

    Permalink

    Return a deep copy for DLEstimator.

    Return a deep copy for DLEstimator. Note that trainSummary and validationSummary will not be copied to the new instance since currently they are not thread-safe.

    Definition Classes
    NNEstimator → DLEstimatorBase → Estimator → PipelineStage → Params
  16. def copyValues[T <: Params](to: T, extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  17. val criterion: Criterion[T]

    Permalink

    BigDL criterion

  18. final def defaultCopy[T <: Params](extra: ParamMap): T

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  19. final val endWhen: Param[Trigger]

    Permalink

    When to stop the training, passed in a Trigger.

    When to stop the training, passed in a Trigger. E.g. Trigger.maxIterations

    Definition Classes
    TrainingParams
  20. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. def explainParam(param: Param[_]): String

    Permalink
    Definition Classes
    Params
  23. def explainParams(): String

    Permalink
    Definition Classes
    Params
  24. final def extractParamMap(): ParamMap

    Permalink
    Definition Classes
    Params
  25. final def extractParamMap(extra: ParamMap): ParamMap

    Permalink
    Definition Classes
    Params
  26. final val featuresCol: Param[String]

    Permalink
    Definition Classes
    HasFeaturesCol
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def fit(dataset: Dataset[_]): NNModel[T]

    Permalink
    Definition Classes
    DLEstimatorBase → Estimator
  29. def fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[NNModel[T]]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  30. def fit(dataset: Dataset[_], paramMap: ParamMap): NNModel[T]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" )
  31. def fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): NNModel[T]

    Permalink
    Definition Classes
    Estimator
    Annotations
    @Since( "2.0.0" ) @varargs()
  32. final def get[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  33. def getBatchSize: Int

    Permalink
    Definition Classes
    HasBatchSize
  34. def getCheckpointPath: String

    Permalink

    Get check point path.

    Get check point path.

    Definition Classes
    TrainingParams
  35. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  36. final def getDefault[T](param: Param[T]): Option[T]

    Permalink
    Definition Classes
    Params
  37. def getEndWhen: Trigger

    Permalink
    Definition Classes
    TrainingParams
  38. final def getFeaturesCol: String

    Permalink
    Definition Classes
    HasFeaturesCol
  39. final def getLabelCol: String

    Permalink
    Definition Classes
    HasLabelCol
  40. def getLearningRate: Double

    Permalink
    Definition Classes
    TrainingParams
  41. def getLearningRateDecay: Double

    Permalink
    Definition Classes
    TrainingParams
  42. def getMaxEpoch: Int

    Permalink
    Definition Classes
    TrainingParams
  43. def getOptimMethod: OptimMethod[T]

    Permalink
    Definition Classes
    TrainingParams
  44. final def getOrDefault[T](param: Param[T]): T

    Permalink
    Definition Classes
    Params
  45. def getParam(paramName: String): Param[Any]

    Permalink
    Definition Classes
    Params
  46. final def getPredictionCol: String

    Permalink
    Definition Classes
    HasPredictionCol
  47. def getSamplePreprocessing: Preprocessing[Any, Sample[T]]

    Permalink
    Definition Classes
    NNParams
  48. def getTrainSummary: Option[TrainSummary]

    Permalink
  49. def getValidation: Option[(Trigger, DataFrame, Array[ValidationMethod[T]], Int)]

    Permalink

    get the validate configuration during training

    get the validate configuration during training

    returns

    an Option of Tuple(ValidationTrigger, Validation data, Array[ValidationMethod[T] ], batchsize)

  50. def getValidationSummary: Option[ValidationSummary]

    Permalink

    Statistics (LearningRate, Loss, Throughput, Parameters) collected during training for the validation data if validation data is set, which can be used for visualization via Tensorboard.

    Statistics (LearningRate, Loss, Throughput, Parameters) collected during training for the validation data if validation data is set, which can be used for visualization via Tensorboard. Use setValidationSummary to enable validation logger. Then the log will be saved to logDir/appName/ as specified by the parameters of validationSummary.

    Default: None

  51. def getVectorSeq(row: Row, colType: DataType, index: Int): Seq[AnyVal]

    Permalink
    Definition Classes
    VectorCompatibility
  52. final def hasDefault[T](param: Param[T]): Boolean

    Permalink
    Definition Classes
    Params
  53. def hasParam(paramName: String): Boolean

    Permalink
    Definition Classes
    Params
  54. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  55. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  56. def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  57. def internalFit(dataFrame: DataFrame): NNModel[T]

    Permalink
    Attributes
    protected
    Definition Classes
    NNEstimator → DLEstimatorBase
  58. def isCachingSample: Boolean

    Permalink
    Definition Classes
    TrainingParams
  59. final def isDefined(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  60. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  61. final def isSet(param: Param[_]): Boolean

    Permalink
    Definition Classes
    Params
  62. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  63. final val l2GradientClippingParams: FloatParam

    Permalink

    L2 norm gradient clipping threshold.

    L2 norm gradient clipping threshold.

    Definition Classes
    TrainingParams
  64. final val labelCol: Param[String]

    Permalink
    Definition Classes
    HasLabelCol
  65. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  66. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  67. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  68. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  69. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  70. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  71. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  72. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  73. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  74. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  75. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  76. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  77. final val maxEpoch: IntParam

    Permalink

    Number of max Epoch for the training, an epoch refers to a traverse over the training data Default: 50

    Number of max Epoch for the training, an epoch refers to a traverse over the training data Default: 50

    Definition Classes
    TrainingParams
  78. val model: Module[T]

    Permalink

    BigDL module to be optimized

  79. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  82. final val optimMethod: Param[OptimMethod[T]]

    Permalink

    optimization method to be used.

    optimization method to be used. BigDL supports many optimization methods like Adam, SGD and LBFGS. Refer to package com.intel.analytics.bigdl.optim for all the options. Default: SGD

    Definition Classes
    TrainingParams
  83. lazy val params: Array[Param[_]]

    Permalink
    Definition Classes
    Params
  84. final val predictionCol: Param[String]

    Permalink
    Definition Classes
    HasPredictionCol
  85. final val samplePreprocessing: Param[Preprocessing[Any, Sample[T]]]

    Permalink
    Definition Classes
    NNParams
  86. final def set(paramPair: ParamPair[_]): NNEstimator.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  87. final def set(param: String, value: Any): NNEstimator.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  88. final def set[T](param: Param[T], value: T): NNEstimator.this.type

    Permalink
    Definition Classes
    Params
  89. def setBatchSize(value: Int): NNEstimator.this.type

    Permalink

    Set global batch size across the cluster.

    Set global batch size across the cluster. Global batch size = Batch per thread * num of cores.

  90. def setCachingSample(value: Boolean): NNEstimator.this.type

    Permalink
  91. def setCheckpoint(path: String, trigger: Trigger, isOverWrite: Boolean = true): NNEstimator.this.type

    Permalink

    Set check points during training.

    Set check points during training. Not enabled by default.

    path

    the directory to save

    trigger

    how often to save the check point

    returns

    this estimator

  92. def setConstantGradientClipping(min: Float, max: Float): NNEstimator.this.type

    Permalink
  93. final def setDefault(paramPairs: ParamPair[_]*): NNEstimator.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  94. final def setDefault[T](param: Param[T], value: T): NNEstimator.this.type

    Permalink
    Attributes
    protected
    Definition Classes
    Params
  95. def setEndWhen(trigger: Trigger): NNEstimator.this.type

    Permalink
  96. def setFeaturesCol(featuresColName: String): NNEstimator.this.type

    Permalink
  97. def setGradientClippingByL2Norm(clipNorm: Float): NNEstimator.this.type

    Permalink
  98. def setLabelCol(labelColName: String): NNEstimator.this.type

    Permalink
  99. def setMaxEpoch(value: Int): NNEstimator.this.type

    Permalink
  100. def setOptimMethod(value: OptimMethod[T]): NNEstimator.this.type

    Permalink
  101. def setPredictionCol(value: String): NNEstimator.this.type

    Permalink
  102. def setSamplePreprocessing[FF, LL](value: Preprocessing[(FF, Option[LL]), Sample[T]]): NNEstimator.this.type

    Permalink
  103. def setTrainSummary(value: TrainSummary): NNEstimator.this.type

    Permalink

    Statistics (LearningRate, Loss, Throughput, Parameters) collected during training for the training data, which can be used for visualization via Tensorboard.

    Statistics (LearningRate, Loss, Throughput, Parameters) collected during training for the training data, which can be used for visualization via Tensorboard. Use setTrainSummary to enable train logger. Then the log will be saved to logDir/appName/train as specified by the parameters of TrainSummary.

    Default: Not enabled

  104. def setValidation(trigger: Trigger, validationDF: DataFrame, vMethods: Array[ValidationMethod[T]], batchSize: Int): NNEstimator.this.type

    Permalink

    Set a validate evaluation during training.

    Set a validate evaluation during training. Default: not enabled.

    trigger

    how often to evaluation validation set

    validationDF

    validate data set

    vMethods

    a set of validation method ValidationMethod

    batchSize

    batch size for validation

    returns

    this estimator

  105. def setValidationSummary(value: ValidationSummary): NNEstimator.this.type

    Permalink

    Enable validation Summary.

    Enable validation Summary. Default: not enabled.

  106. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    Identifiable → AnyRef → Any
  108. def transformSchema(schema: StructType): StructType

    Permalink
    Definition Classes
    NNEstimator → PipelineStage
  109. def transformSchema(schema: StructType, logging: Boolean): StructType

    Permalink
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  110. val uid: String

    Permalink
    Definition Classes
    NNEstimator → Identifiable
  111. def unwrapVectorAsNecessary(colType: DataType): (Row, Int) ⇒ Any

    Permalink
    Attributes
    protected
    Definition Classes
    NNParams
  112. val validVectorTypes: Seq[UserDefinedType[_ >: Vector with Vector <: Serializable] { def sqlType: org.apache.spark.sql.types.StructType }]

    Permalink
    Definition Classes
    VectorCompatibility
  113. def validateParams(schema: StructType): Unit

    Permalink
    Attributes
    protected
  114. var validationBatchSize: Int

    Permalink
    Attributes
    protected
  115. var validationDF: DataFrame

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  121. def wrapBigDLModel(m: Module[T]): NNModel[T]

    Permalink

    sub classes can extend the method and return required model for different transform tasks

    sub classes can extend the method and return required model for different transform tasks

    Attributes
    protected

Deprecated Value Members

  1. final val learningRate: DoubleParam

    Permalink

    learning rate for the optimizer in the NNEstimator.

    learning rate for the optimizer in the NNEstimator. Default: 0.001 :: deprecated, please set the learning rate with optimMethod directly.

    Definition Classes
    TrainingParams
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) Please set the learning rate with optimMethod directly

  2. final val learningRateDecay: DoubleParam

    Permalink

    learning rate decay for each iteration.

    learning rate decay for each iteration. Default: 0 :: deprecated, please set the learning rate decay with optimMethod directly.

    Definition Classes
    TrainingParams
    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) Please set the learning rate decay with optimMethod directly

  3. def setLearningRate(value: Double): NNEstimator.this.type

    Permalink

    :: deprecated, please set the learning rate with optimMethod directly.

    :: deprecated, please set the learning rate with optimMethod directly.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) Please set with optimMethod directly

  4. def setLearningRateDecay(value: Double): NNEstimator.this.type

    Permalink

    :: deprecated, please set with optimMethod directly.

    :: deprecated, please set with optimMethod directly.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.4.0) Please set with optimMethod directly.

Inherited from TrainingParams[T]

Inherited from NNParams[T]

Inherited from VectorCompatibility

Inherited from HasBatchSize

Inherited from HasPredictionCol

Inherited from HasPredictionCol

Inherited from HasFeaturesCol

Inherited from HasFeaturesCol

Inherited from DLEstimatorBase[NNEstimator[T], NNModel[T]]

Inherited from HasLabelCol

Inherited from Estimator[NNModel[T]]

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Ungrouped