class DLEstimator[T] extends DLEstimatorBase[DLEstimator[T], DLModel[T]] with DLParams[T]
DLEstimator helps to train a BigDL Model with the Spark ML Estimator/Transfomer pattern, thus Spark users can conveniently fit BigDL into Spark ML pipeline.
DLEstimator supports feature and label data in the format of Array[Double], Array[Float], org.apache.spark.mllib.linalg.{Vector, VectorUDT}, org.apache.spark.ml.linalg.{Vector, VectorUDT}, Double and Float.
User should specify the feature data dimensions and label data dimensions via the constructor parameters featureSize and labelSize respectively. Internally the feature and label data are converted to BigDL tensors, to further train a BigDL model efficiently.
For details usage, please refer to examples in package com.intel.analytics.bigdl.example.MLPipeline
- Annotations
- @deprecated
- Deprecated
(Since version 0.10.0)
- Alphabetic
- By Inheritance
- DLEstimator
- DLParams
- HasBatchSize
- VectorCompatibility
- HasPredictionCol
- HasPredictionCol
- HasFeaturesCol
- HasFeaturesCol
- DLEstimatorBase
- HasLabelCol
- Estimator
- PipelineStage
- Logging
- Params
- Serializable
- Serializable
- Identifiable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
DLEstimator(model: Module[T], criterion: Criterion[T], featureSize: Array[Int], labelSize: Array[Int], uid: String = "DLEstimator")(implicit arg0: ClassTag[T], ev: TensorNumeric[T])
- model
BigDL module to be optimized
- criterion
BigDL criterion method
- featureSize
The size (Tensor dimensions) of the feature data. e.g. an image may be with width * height = 28 * 28, featureSize = Array(28, 28).
- labelSize
The size (Tensor dimensions) of the label data.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
$[T](param: Param[T]): T
- Attributes
- protected
- Definition Classes
- Params
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
val
batchSize: Param[Int]
- Definition Classes
- HasBatchSize
-
final
def
clear(param: Param[_]): DLEstimator.this.type
- Definition Classes
- Params
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
copy(extra: ParamMap): DLEstimator[T]
- Definition Classes
- DLEstimator → DLEstimatorBase → Estimator → PipelineStage → Params
-
def
copyValues[T <: Params](to: T, extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
- val criterion: Criterion[T]
-
final
def
defaultCopy[T <: Params](extra: ParamMap): T
- Attributes
- protected
- Definition Classes
- Params
-
final
val
endWhen: Param[Trigger]
When to stop the training, passed in a Trigger.
When to stop the training, passed in a Trigger. E.g. Trigger.maxIterations
- Definition Classes
- DLParams
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
explainParam(param: Param[_]): String
- Definition Classes
- Params
-
def
explainParams(): String
- Definition Classes
- Params
-
final
def
extractParamMap(): ParamMap
- Definition Classes
- Params
-
final
def
extractParamMap(extra: ParamMap): ParamMap
- Definition Classes
- Params
- val featureSize: Array[Int]
-
final
val
featuresCol: Param[String]
- Definition Classes
- HasFeaturesCol
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fit(dataset: Dataset[_]): DLModel[T]
- Definition Classes
- DLEstimatorBase → Estimator
-
def
fit(dataset: Dataset[_], paramMaps: Array[ParamMap]): Seq[DLModel[T]]
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" )
-
def
fit(dataset: Dataset[_], paramMap: ParamMap): DLModel[T]
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" )
-
def
fit(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DLModel[T]
- Definition Classes
- Estimator
- Annotations
- @Since( "2.0.0" ) @varargs()
-
final
def
get[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getBatchSize: Int
- Definition Classes
- HasBatchSize
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getConvertFunc(colType: DataType): (Row, Int) ⇒ Seq[AnyVal]
Get conversion function to extract data from original DataFrame Default: 0
Get conversion function to extract data from original DataFrame Default: 0
- Attributes
- protected
- Definition Classes
- DLParams
-
final
def
getDefault[T](param: Param[T]): Option[T]
- Definition Classes
- Params
-
def
getEndWhen: Trigger
- Definition Classes
- DLParams
-
final
def
getFeaturesCol: String
- Definition Classes
- HasFeaturesCol
-
final
def
getLabelCol: String
- Definition Classes
- HasLabelCol
-
def
getLearningRate: Double
- Definition Classes
- DLParams
-
def
getLearningRateDecay: Double
- Definition Classes
- DLParams
-
def
getMaxEpoch: Int
- Definition Classes
- DLParams
-
def
getOptimMethod: OptimMethod[T]
- Definition Classes
- DLParams
-
final
def
getOrDefault[T](param: Param[T]): T
- Definition Classes
- Params
-
def
getParam(paramName: String): Param[Any]
- Definition Classes
- Params
-
final
def
getPredictionCol: String
- Definition Classes
- HasPredictionCol
- def getTrainSummary: Option[TrainSummary]
-
def
getValidationSummary: Option[ValidationSummary]
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
-
def
getVectorSeq(row: Row, colType: DataType, index: Int): Seq[AnyVal]
- Definition Classes
- VectorCompatibility
-
final
def
hasDefault[T](param: Param[T]): Boolean
- Definition Classes
- Params
-
def
hasParam(paramName: String): Boolean
- Definition Classes
- Params
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
internalFit(dataFrame: DataFrame): DLModel[T]
- Attributes
- protected
- Definition Classes
- DLEstimator → DLEstimatorBase
-
final
def
isDefined(param: Param[_]): Boolean
- Definition Classes
- Params
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isSet(param: Param[_]): Boolean
- Definition Classes
- Params
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
final
val
labelCol: Param[String]
- Definition Classes
- HasLabelCol
- val labelSize: Array[Int]
-
final
val
learningRate: DoubleParam
learning rate for the optimizer in the DLEstimator.
learning rate for the optimizer in the DLEstimator. Default: 0.001
- Definition Classes
- DLParams
-
final
val
learningRateDecay: DoubleParam
learning rate decay for each iteration.
learning rate decay for each iteration. Default: 0
- Definition Classes
- DLParams
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
final
val
maxEpoch: IntParam
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
- DLParams
- val model: Module[T]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
val
optimMethod: Param[OptimMethod[T]]
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
- DLParams
-
lazy val
params: Array[Param[_]]
- Definition Classes
- Params
-
final
val
predictionCol: Param[String]
- Definition Classes
- HasPredictionCol
-
final
def
set(paramPair: ParamPair[_]): DLEstimator.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set(param: String, value: Any): DLEstimator.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
set[T](param: Param[T], value: T): DLEstimator.this.type
- Definition Classes
- Params
- def setBatchSize(value: Int): DLEstimator.this.type
-
final
def
setDefault(paramPairs: ParamPair[_]*): DLEstimator.this.type
- Attributes
- protected
- Definition Classes
- Params
-
final
def
setDefault[T](param: Param[T], value: T): DLEstimator.this.type
- Attributes
- protected
- Definition Classes
- Params
- def setEndWhen(trigger: Trigger): DLEstimator.this.type
- def setFeaturesCol(featuresColName: String): DLEstimator.this.type
- def setLabelCol(labelColName: String): DLEstimator.this.type
- def setLearningRate(value: Double): DLEstimator.this.type
- def setLearningRateDecay(value: Double): DLEstimator.this.type
- def setMaxEpoch(value: Int): DLEstimator.this.type
- def setOptimMethod(value: OptimMethod[T]): DLEstimator.this.type
- def setPredictionCol(value: String): DLEstimator.this.type
-
def
setTrainSummary(value: TrainSummary): DLEstimator.this.type
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
-
def
setValidation(trigger: Trigger, validationDF: DataFrame, vMethods: Array[ValidationMethod[T]], batchSize: Int): DLEstimator.this.type
Set a validate evaluation during training
Set a validate evaluation during training
- 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 optimizer
-
def
setValidationSummary(value: ValidationSummary): DLEstimator.this.type
Enable validation Summary
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Identifiable → AnyRef → Any
-
def
transformSchema(schema: StructType): StructType
- Definition Classes
- DLEstimator → PipelineStage
-
def
transformSchema(schema: StructType, logging: Boolean): StructType
- Attributes
- protected
- Definition Classes
- PipelineStage
- Annotations
- @DeveloperApi()
-
val
uid: String
- Definition Classes
- DLEstimator → Identifiable
-
val
validVectorTypes: Seq[UserDefinedType[_ >: Vector with Vector <: Serializable] { def sqlType: org.apache.spark.sql.types.StructType }]
- Definition Classes
- VectorCompatibility
-
def
validateDataType(schema: StructType, colName: String): Unit
Validate if feature and label columns are of supported data types.
Validate if feature and label columns are of supported data types. Default: 0
- Attributes
- protected
- Definition Classes
- DLParams
-
def
validateParams(schema: StructType): Unit
- Attributes
- protected
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
wrapBigDLModel(m: Module[T], featureSize: Array[Int]): DLModel[T]
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