public abstract class AbstractDataSetNormalizer<S extends NormalizerStats> extends AbstractNormalizer implements DataNormalization
DataSet
instances
or iteratorsModifier and Type | Field and Description |
---|---|
protected NormalizerStrategy<S> |
strategy |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataSetNormalizer(NormalizerStrategy<S> strategy) |
Modifier and Type | Method and Description |
---|---|
void |
fit(DataSet dataSet)
Fit a dataset (only compute based on the statistics from this dataset)
|
void |
fit(DataSetIterator iterator)
Fit the given model
|
void |
fitLabel(boolean fitLabels)
Flag to specify if the labels/outputs in the dataset should be also normalized
default value is false
|
protected S |
getFeatureStats() |
protected S |
getLabelStats() |
protected boolean |
isFit() |
boolean |
isFitLabel()
Whether normalization for the labels is also enabled.
|
protected abstract NormalizerStats.Builder |
newBuilder() |
void |
preProcess(DataSet toPreProcess)
Pre process a dataset
|
void |
revert(DataSet data)
Revert the data to what it was before transform
|
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 given dataset
|
void |
transform(INDArray features)
Transform the given INDArray
|
void |
transform(INDArray features,
INDArray featuresMask)
Transform the features, with an optional mask array
|
void |
transformLabel(INDArray label)
Transform the labels.
|
void |
transformLabel(INDArray label,
INDArray labelsMask)
Transform the labels.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
protected NormalizerStrategy<S extends NormalizerStats> strategy
protected AbstractDataSetNormalizer(NormalizerStrategy<S> strategy)
public void fitLabel(boolean fitLabels)
fitLabel
in interface DataNormalization
fitLabels
- public boolean isFitLabel()
isFitLabel
in interface DataNormalization
public void fit(DataSet dataSet)
fit
in interface Normalizer<DataSet>
dataSet
- the dataset to compute onprotected S getFeatureStats()
protected S getLabelStats()
protected boolean isFit()
isFit
in class AbstractNormalizer
public void fit(DataSetIterator iterator)
fit
in interface DataNormalization
iterator
- for the data to iterate overprotected abstract NormalizerStats.Builder newBuilder()
public void preProcess(@NonNull DataSet toPreProcess)
preProcess
in interface DataSetPreProcessor
preProcess
in interface DataNormalization
toPreProcess
- the data set to pre processpublic void transform(DataSet toPreProcess)
transform
in interface Normalizer<DataSet>
toPreProcess
- public void transform(INDArray features)
transform
in interface DataNormalization
features
- public 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)
isFitLabel()
== false, this is a no-optransformLabel
in interface DataNormalization
public void transformLabel(INDArray label, INDArray labelsMask)
DataNormalization
DataNormalization.isFitLabel()
== false, this is a no-optransformLabel
in interface DataNormalization
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)
isFitLabel()
== 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 revert(DataSet data)
revert
in interface Normalizer<DataSet>
data
- the dataset to revert backCopyright © 2018. All rights reserved.