public class VGG16ImagePreProcessor extends Object implements DataNormalization
Modifier and Type | Field and Description |
---|---|
static INDArray |
VGG_MEAN_OFFSET_BGR |
static INDArray |
VGG_MEAN_OFFSET_BGR_FLOAT |
static INDArray |
VGG_MEAN_OFFSET_BGR_FLOAT16 |
Constructor and Description |
---|
VGG16ImagePreProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
fit(DataSet dataSet)
Fit a dataset (only compute
based on the statistics from this dataset0
|
void |
fit(DataSetIterator iterator)
Iterates over a dataset
accumulating statistics for normalization
|
void |
fitLabel(boolean fitLabels)
Flag to specify if the labels/outputs in the dataset should be also normalized.
|
protected static INDArray |
getMeanFor(INDArray features) |
NormalizerType |
getType()
Get the enum opType of this normalizer
|
boolean |
isFitLabel()
Whether normalization for the labels is also enabled.
|
void |
preProcess(DataSet toPreProcess)
Pre process a dataset
|
void |
preProcess(INDArray features) |
void |
revert(DataSet toRevert)
Undo (revert) the normalization applied by this DataNormalization instance (arrays are modified in-place)
|
void |
revertFeatures(INDArray features)
Undo (revert) the normalization applied by this DataNormalization instance to the specified features array
|
void |
revertFeatures(INDArray features,
INDArray featuresMask)
Undo (revert) the normalization applied by this DataNormalization instance to the specified features array
|
void |
revertLabels(INDArray labels)
Undo (revert) the normalization applied by this DataNormalization instance to the specified labels array.
|
void |
revertLabels(INDArray labels,
INDArray labelsMask)
Undo (revert) the normalization applied by this DataNormalization instance to the specified labels array.
|
void |
transform(DataSet toPreProcess)
Transform the data
|
void |
transform(INDArray features)
Transform the dataset
|
void |
transform(INDArray features,
INDArray featuresMask)
Transform the features, with an optional mask array
|
void |
transformLabel(INDArray label)
Transform the labels.
|
void |
transformLabel(INDArray labels,
INDArray labelsMask)
Transform the labels.
|
public static final INDArray VGG_MEAN_OFFSET_BGR
public static final INDArray VGG_MEAN_OFFSET_BGR_FLOAT
public static final INDArray VGG_MEAN_OFFSET_BGR_FLOAT16
public void fit(DataSet dataSet)
fit
in interface Normalizer<DataSet>
dataSet
- the dataset to compute onpublic void fit(DataSetIterator iterator)
fit
in interface DataNormalization
iterator
- the iterator to use for
collecting statistics.public void preProcess(DataSet toPreProcess)
DataSetPreProcessor
preProcess
in interface DataSetPreProcessor
preProcess
in interface DataNormalization
toPreProcess
- the data set to pre processpublic void preProcess(INDArray features)
public void transform(DataSet toPreProcess)
transform
in interface Normalizer<DataSet>
toPreProcess
- the dataset to transformpublic void transform(INDArray features)
DataNormalization
transform
in interface DataNormalization
features
- the features to pre processpublic void transform(INDArray features, INDArray featuresMask)
DataNormalization
transform
in interface DataNormalization
features
- the features to pre processfeaturesMask
- the mask array to pre processpublic void transformLabel(INDArray label)
DataNormalization
DataNormalization.isFitLabel()
== false, this is a no-optransformLabel
in interface DataNormalization
public void transformLabel(INDArray labels, INDArray labelsMask)
DataNormalization
DataNormalization.isFitLabel()
== false, this is a no-optransformLabel
in interface DataNormalization
public void revert(DataSet toRevert)
Normalizer
revert
in interface Normalizer<DataSet>
toRevert
- DataSet to revert the normalization onpublic NormalizerType getType()
Normalizer
getType
in interface Normalizer<DataSet>
NormalizerSerializerStrategy.getSupportedType()
public void revertFeatures(INDArray features)
DataNormalization
revertFeatures
in interface DataNormalization
features
- Features to revert the normalization onpublic void revertFeatures(INDArray features, INDArray featuresMask)
DataNormalization
revertFeatures
in interface DataNormalization
features
- Features to revert the normalization onpublic void revertLabels(INDArray labels)
DataNormalization
#isFitLabels()
== false) then this is a no-op.
Can also be used to undo normalization for network output arrays, in the case of regression.revertLabels
in interface DataNormalization
labels
- Labels array to revert the normalization onpublic void revertLabels(INDArray labels, INDArray labelsMask)
DataNormalization
#isFitLabels()
== false) then this is a no-op.
Can also be used to undo normalization for network output arrays, in the case of regression.revertLabels
in interface DataNormalization
labels
- Labels array to revert the normalization onlabelsMask
- Labels mask array (may be null)public void fitLabel(boolean fitLabels)
DataNormalization
fitLabel
in interface DataNormalization
public boolean isFitLabel()
DataNormalization
isFitLabel
in interface DataNormalization
Copyright © 2020. All rights reserved.