class ImageFeaturizer extends Transformer with HasInputCol with HasOutputCol with Wrappable with ComplexParamsWritable with BasicLogging
The ImageFeaturizer
relies on a CNTK model to do the featurization, one can set
this model using the modelLocation
parameter. To map the nodes of the CNTK model
onto the standard "layers" structure of a feed forward neural net, one needs to supply a list of
node names that range from the output node, back towards the input node of the CNTK Function.
This list does not need to be exhaustive, and is provided to you if you use a model downloaded
from the ModelDownloader
, one can find this layer list in the schema of the
downloaded model.
The ImageFeaturizer
takes an input column of images (the type returned by the
ImageReader
), and automatically resizes them to fit the CMTKModel's inputs. It
then feeds them through a pre-trained CNTK model. One can truncate the model using the
cutOutputLayers
parameter that determines how many layers to truncate from the output of
the network. For example, layer=0 means that no layers are removed, layer=2 means that the
image featurizer returns the activations of the layer that is two layers from the output layer.
- Alphabetic
- By Inheritance
- ImageFeaturizer
- BasicLogging
- ComplexParamsWritable
- MLWritable
- Wrappable
- RWrappable
- PythonWrappable
- BaseWrappable
- HasOutputCol
- HasInputCol
- Transformer
- PipelineStage
- Logging
- Params
- Serializable
- Serializable
- Identifiable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
clear(param: Param[_]): ImageFeaturizer.this.type
- Definition Classes
- Params
- val cntkModel: TransformerParam
-
def
copy(extra: ParamMap): Transformer
- Definition Classes
- ImageFeaturizer → Transformer → PipelineStage → Params
-
val
cutOutputLayers: IntParam
The number of layer to cut off the end of the network; 0 leaves the network intact, 1 removes the output layer, etc.
- val dropNa: BooleanParam
- val emptyCntkModel: CNTKModel
-
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
-
final
def
get[T](param: Param[T]): Option[T]
- Definition Classes
- Params
- def getCntkModel: CNTKModel
- def getCutOutputLayers: Int
-
final
def
getDefault[T](param: Param[T]): Option[T]
- Definition Classes
- Params
- def getDropNa: Boolean
-
def
getInputCol: String
- Definition Classes
- HasInputCol
- def getInputNode: Int
- def getLayerNames: Array[String]
- def getMiniBatchSize: Int
- def getModel: SerializableFunction
-
final
def
getOrDefault[T](param: Param[T]): T
- Definition Classes
- Params
-
def
getOutputCol: String
- Definition Classes
- HasOutputCol
-
def
getParam(paramName: String): Param[Any]
- Definition Classes
- Params
-
final
def
hasDefault[T](param: Param[T]): Boolean
- Definition Classes
- Params
-
def
hasParam(paramName: String): Boolean
- Definition Classes
- Params
-
val
inputCol: Param[String]
The name of the input column
The name of the input column
- Definition Classes
- HasInputCol
-
final
def
isDefined(param: Param[_]): Boolean
- Definition Classes
- Params
-
final
def
isSet(param: Param[_]): Boolean
- Definition Classes
- Params
-
val
layerNames: StringArrayParam
Array with valid CNTK nodes to choose from; the first entries of this array should be closer to the output node.
-
def
logClass(): Unit
- Definition Classes
- BasicLogging
-
def
logFit[T](f: ⇒ T): T
- Definition Classes
- BasicLogging
-
def
logPredict[T](f: ⇒ T): T
- Definition Classes
- BasicLogging
-
def
logTrain[T](f: ⇒ T): T
- Definition Classes
- BasicLogging
-
def
logTransform[T](f: ⇒ T): T
- Definition Classes
- BasicLogging
-
def
logVerb[T](verb: String, f: ⇒ T): T
- Definition Classes
- BasicLogging
-
def
makePyFile(conf: CodegenConfig): Unit
- Definition Classes
- PythonWrappable
-
def
makeRFile(conf: CodegenConfig): Unit
- Definition Classes
- RWrappable
-
val
outputCol: Param[String]
The name of the output column
The name of the output column
- Definition Classes
- HasOutputCol
-
lazy val
params: Array[Param[_]]
- Definition Classes
- Params
-
def
pyAdditionalMethods: String
- Definition Classes
- PythonWrappable
-
def
pyInitFunc(): String
- Definition Classes
- PythonWrappable
-
def
save(path: String): Unit
- Definition Classes
- MLWritable
- Annotations
- @Since( "1.6.0" ) @throws( ... )
-
final
def
set[T](param: Param[T], value: T): ImageFeaturizer.this.type
- Definition Classes
- Params
- def setCntkModel(value: CNTKModel): ImageFeaturizer.this.type
- def setCutOutputLayers(value: Int): ImageFeaturizer.this.type
- def setDropNa(value: Boolean): ImageFeaturizer.this.type
-
def
setInputCol(value: String): ImageFeaturizer.this.type
- Definition Classes
- HasInputCol
- def setInputNode(value: Int): ImageFeaturizer.this.type
- def setLayerNames(value: Array[String]): ImageFeaturizer.this.type
- def setMiniBatchSize(value: Int): ImageFeaturizer.this.type
- def setModel(model: SerializableFunction): ImageFeaturizer.this.type
- def setModel(modelSchema: ModelSchema): ImageFeaturizer.this.type
- def setModelLocation(path: String): ImageFeaturizer.this.type
-
def
setOutputCol(value: String): ImageFeaturizer.this.type
- Definition Classes
- HasOutputCol
-
def
toString(): String
- Definition Classes
- Identifiable → AnyRef → Any
-
def
transform(dataset: Dataset[_]): DataFrame
- Definition Classes
- ImageFeaturizer → Transformer
-
def
transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" )
-
def
transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
- Definition Classes
- Transformer
- Annotations
- @Since( "2.0.0" ) @varargs()
-
def
transformSchema(schema: StructType): StructType
Add the features column to the schema
Add the features column to the schema
- returns
schema with features column
- Definition Classes
- ImageFeaturizer → PipelineStage
-
val
uid: String
- Definition Classes
- ImageFeaturizer → BasicLogging → Identifiable
-
val
ver: String
- Definition Classes
- BasicLogging
-
def
write: MLWriter
- Definition Classes
- ComplexParamsWritable → MLWritable