public class MultiNormalizerHybrid extends AbstractNormalizer implements MultiDataNormalization, Serializable
By default, no normalization is applied. There are methods to configure the desired normalization strategy for inputs and outputs either globally or on an individual input/output level. Specific input/output strategies will override global ones.
Constructor and Description |
---|
MultiNormalizerHybrid() |
Modifier and Type | Method and Description |
---|---|
void |
fit(MultiDataSet dataSet)
Fit a MultiDataSet (only compute based on the statistics from this dataset)
|
void |
fit(MultiDataSetIterator iterator)
Iterates over a dataset
accumulating statistics for normalization
|
Map<Integer,NormalizerStats> |
getInputStats()
Get the map of normalization statistics per input
|
NormalizerStats |
getInputStats(int input)
Get normalization statistics for a given input.
|
Map<Integer,NormalizerStats> |
getOutputStats()
Get the map of normalization statistics per output
|
NormalizerStats |
getOutputStats(int output)
Get normalization statistics for a given output.
|
NormalizerType |
getType()
Get the enum opType of this normalizer
|
protected boolean |
isFit() |
MultiNormalizerHybrid |
minMaxScaleAllInputs()
Apply min-max scaling to all inputs, except the ones individually configured
|
MultiNormalizerHybrid |
minMaxScaleAllInputs(double rangeFrom,
double rangeTo)
Apply min-max scaling to all inputs, except the ones individually configured
|
MultiNormalizerHybrid |
minMaxScaleAllOutputs()
Apply min-max scaling to all outputs, except the ones individually configured
|
MultiNormalizerHybrid |
minMaxScaleAllOutputs(double rangeFrom,
double rangeTo)
Apply min-max scaling to all outputs, except the ones individually configured
|
MultiNormalizerHybrid |
minMaxScaleInput(int input)
Apply min-max scaling to a specific input, overriding the global input strategy if any
|
MultiNormalizerHybrid |
minMaxScaleInput(int input,
double rangeFrom,
double rangeTo)
Apply min-max scaling to a specific input, overriding the global input strategy if any
|
MultiNormalizerHybrid |
minMaxScaleOutput(int output)
Apply min-max scaling to a specific output, overriding the global output strategy if any
|
MultiNormalizerHybrid |
minMaxScaleOutput(int output,
double rangeFrom,
double rangeTo)
Apply min-max scaling to a specific output, overriding the global output strategy if any
|
void |
preProcess(MultiDataSet data)
Preprocess the MultiDataSet
|
void |
revert(MultiDataSet data)
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 entire inputs array
|
void |
revertFeatures(INDArray[] features,
INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs array
|
void |
revertFeatures(INDArray[] features,
INDArray[] maskArrays,
int input)
Undo (revert) the normalization applied by this DataNormalization instance to the features of a particular input
|
void |
revertLabels(INDArray[] labels)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs array
|
void |
revertLabels(INDArray[] labels,
INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs array
|
void |
revertLabels(INDArray[] labels,
INDArray[] maskArrays,
int output)
Undo (revert) the normalization applied by this DataNormalization instance to the labels of a particular output
|
MultiNormalizerHybrid |
standardizeAllInputs()
Apply standardization to all inputs, except the ones individually configured
|
MultiNormalizerHybrid |
standardizeAllOutputs()
Apply standardization to all outputs, except the ones individually configured
|
MultiNormalizerHybrid |
standardizeInput(int input)
Apply standardization to a specific input, overriding the global input strategy if any
|
MultiNormalizerHybrid |
standardizeOutput(int output)
Apply standardization to a specific output, overriding the global output strategy if any
|
void |
transform(MultiDataSet data)
Transform the dataset
|
public MultiNormalizerHybrid standardizeAllInputs()
public MultiNormalizerHybrid minMaxScaleAllInputs()
public MultiNormalizerHybrid minMaxScaleAllInputs(double rangeFrom, double rangeTo)
rangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target rangepublic MultiNormalizerHybrid standardizeInput(int input)
input
- the index of the inputpublic MultiNormalizerHybrid minMaxScaleInput(int input)
input
- the index of the inputpublic MultiNormalizerHybrid minMaxScaleInput(int input, double rangeFrom, double rangeTo)
input
- the index of the inputrangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target rangepublic MultiNormalizerHybrid standardizeAllOutputs()
public MultiNormalizerHybrid minMaxScaleAllOutputs()
public MultiNormalizerHybrid minMaxScaleAllOutputs(double rangeFrom, double rangeTo)
rangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target rangepublic MultiNormalizerHybrid standardizeOutput(int output)
output
- the index of the inputpublic MultiNormalizerHybrid minMaxScaleOutput(int output)
output
- the index of the inputpublic MultiNormalizerHybrid minMaxScaleOutput(int output, double rangeFrom, double rangeTo)
output
- the index of the inputrangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target rangepublic NormalizerStats getInputStats(int input)
input
- the index of the inputpublic NormalizerStats getOutputStats(int output)
output
- the index of the outputpublic Map<Integer,NormalizerStats> getInputStats()
public Map<Integer,NormalizerStats> getOutputStats()
public void fit(@NonNull MultiDataSet dataSet)
fit
in interface Normalizer<MultiDataSet>
dataSet
- the dataset to compute onpublic void fit(@NonNull MultiDataSetIterator iterator)
fit
in interface MultiDataNormalization
iterator
- the iterator to use for collecting statisticspublic void transform(@NonNull MultiDataSet data)
transform
in interface Normalizer<MultiDataSet>
data
- the dataset to pre processpublic void preProcess(@NonNull MultiDataSet data)
MultiDataSetPreProcessor
preProcess
in interface MultiDataSetPreProcessor
preProcess
in interface MultiDataNormalization
public void revert(@NonNull MultiDataSet data)
revert
in interface Normalizer<MultiDataSet>
data
- MultiDataSet to revert the normalization onpublic NormalizerType getType()
Normalizer
getType
in interface Normalizer<MultiDataSet>
NormalizerSerializerStrategy.getSupportedType()
public void revertFeatures(@NonNull INDArray[] features)
revertFeatures
in interface MultiDataNormalization
features
- The normalized array of inputspublic void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays)
revertFeatures
in interface MultiDataNormalization
features
- The normalized array of inputsmaskArrays
- Optional mask arrays belonging to the inputspublic void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input)
features
- The normalized array of inputsmaskArrays
- Optional mask arrays belonging to the inputsinput
- the index of the input to revert normalization onpublic void revertLabels(@NonNull INDArray[] labels)
revertLabels
in interface MultiDataNormalization
labels
- The normalized array of outputspublic void revertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays)
revertLabels
in interface MultiDataNormalization
labels
- The normalized array of outputsmaskArrays
- Optional mask arrays belonging to the outputspublic void revertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays, int output)
labels
- The normalized array of outputsmaskArrays
- Optional mask arrays belonging to the outputsoutput
- the index of the output to revert normalization onprotected boolean isFit()
isFit
in class AbstractNormalizer
Copyright © 2019. All rights reserved.