Class MultiNormalizerHybrid
- java.lang.Object
-
- org.nd4j.linalg.dataset.api.preprocessor.AbstractNormalizer
-
- org.nd4j.linalg.dataset.api.preprocessor.MultiNormalizerHybrid
-
- All Implemented Interfaces:
Serializable
,MultiDataSetPreProcessor
,MultiDataNormalization
,Normalizer<MultiDataSet>
public class MultiNormalizerHybrid extends AbstractNormalizer implements MultiDataNormalization, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiNormalizerHybrid()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fit(@NonNull MultiDataSetIterator iterator)
Iterates over a dataset accumulating statistics for normalizationvoid
fit(@NonNull MultiDataSet dataSet)
Fit a MultiDataSet (only compute based on the statistics from this dataset)Map<Integer,NormalizerStats>
getInputStats()
Get the map of normalization statistics per inputNormalizerStats
getInputStats(int input)
Get normalization statistics for a given input.Map<Integer,NormalizerStats>
getOutputStats()
Get the map of normalization statistics per outputNormalizerStats
getOutputStats(int output)
Get normalization statistics for a given output.NormalizerType
getType()
Get the enum opType of this normalizerprotected boolean
isFit()
MultiNormalizerHybrid
minMaxScaleAllInputs()
Apply min-max scaling to all inputs, except the ones individually configuredMultiNormalizerHybrid
minMaxScaleAllInputs(double rangeFrom, double rangeTo)
Apply min-max scaling to all inputs, except the ones individually configuredMultiNormalizerHybrid
minMaxScaleAllOutputs()
Apply min-max scaling to all outputs, except the ones individually configuredMultiNormalizerHybrid
minMaxScaleAllOutputs(double rangeFrom, double rangeTo)
Apply min-max scaling to all outputs, except the ones individually configuredMultiNormalizerHybrid
minMaxScaleInput(int input)
Apply min-max scaling to a specific input, overriding the global input strategy if anyMultiNormalizerHybrid
minMaxScaleInput(int input, double rangeFrom, double rangeTo)
Apply min-max scaling to a specific input, overriding the global input strategy if anyMultiNormalizerHybrid
minMaxScaleOutput(int output)
Apply min-max scaling to a specific output, overriding the global output strategy if anyMultiNormalizerHybrid
minMaxScaleOutput(int output, double rangeFrom, double rangeTo)
Apply min-max scaling to a specific output, overriding the global output strategy if anyvoid
preProcess(@NonNull MultiDataSet data)
Preprocess the MultiDataSetvoid
revert(@NonNull MultiDataSet data)
Undo (revert) the normalization applied by this DataNormalization instance (arrays are modified in-place)void
revertFeatures(@NonNull INDArray[] features)
Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs arrayvoid
revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs arrayvoid
revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input)
Undo (revert) the normalization applied by this DataNormalization instance to the features of a particular inputvoid
revertLabels(@NonNull INDArray[] labels)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs arrayvoid
revertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs arrayvoid
revertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays, int output)
Undo (revert) the normalization applied by this DataNormalization instance to the labels of a particular outputMultiNormalizerHybrid
standardizeAllInputs()
Apply standardization to all inputs, except the ones individually configuredMultiNormalizerHybrid
standardizeAllOutputs()
Apply standardization to all outputs, except the ones individually configuredMultiNormalizerHybrid
standardizeInput(int input)
Apply standardization to a specific input, overriding the global input strategy if anyMultiNormalizerHybrid
standardizeOutput(int output)
Apply standardization to a specific output, overriding the global output strategy if anyvoid
transform(@NonNull MultiDataSet data)
Transform the dataset
-
-
-
Method Detail
-
standardizeAllInputs
public MultiNormalizerHybrid standardizeAllInputs()
Apply standardization to all inputs, except the ones individually configured- Returns:
- the normalizer
-
minMaxScaleAllInputs
public MultiNormalizerHybrid minMaxScaleAllInputs()
Apply min-max scaling to all inputs, except the ones individually configured- Returns:
- the normalizer
-
minMaxScaleAllInputs
public MultiNormalizerHybrid minMaxScaleAllInputs(double rangeFrom, double rangeTo)
Apply min-max scaling to all inputs, except the ones individually configured- Parameters:
rangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target range- Returns:
- the normalizer
-
standardizeInput
public MultiNormalizerHybrid standardizeInput(int input)
Apply standardization to a specific input, overriding the global input strategy if any- Parameters:
input
- the index of the input- Returns:
- the normalizer
-
minMaxScaleInput
public MultiNormalizerHybrid minMaxScaleInput(int input)
Apply min-max scaling to a specific input, overriding the global input strategy if any- Parameters:
input
- the index of the input- Returns:
- the normalizer
-
minMaxScaleInput
public MultiNormalizerHybrid minMaxScaleInput(int input, double rangeFrom, double rangeTo)
Apply min-max scaling to a specific input, overriding the global input strategy if any- Parameters:
input
- the index of the inputrangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target range- Returns:
- the normalizer
-
standardizeAllOutputs
public MultiNormalizerHybrid standardizeAllOutputs()
Apply standardization to all outputs, except the ones individually configured- Returns:
- the normalizer
-
minMaxScaleAllOutputs
public MultiNormalizerHybrid minMaxScaleAllOutputs()
Apply min-max scaling to all outputs, except the ones individually configured- Returns:
- the normalizer
-
minMaxScaleAllOutputs
public MultiNormalizerHybrid minMaxScaleAllOutputs(double rangeFrom, double rangeTo)
Apply min-max scaling to all outputs, except the ones individually configured- Parameters:
rangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target range- Returns:
- the normalizer
-
standardizeOutput
public MultiNormalizerHybrid standardizeOutput(int output)
Apply standardization to a specific output, overriding the global output strategy if any- Parameters:
output
- the index of the input- Returns:
- the normalizer
-
minMaxScaleOutput
public MultiNormalizerHybrid minMaxScaleOutput(int output)
Apply min-max scaling to a specific output, overriding the global output strategy if any- Parameters:
output
- the index of the input- Returns:
- the normalizer
-
minMaxScaleOutput
public MultiNormalizerHybrid minMaxScaleOutput(int output, double rangeFrom, double rangeTo)
Apply min-max scaling to a specific output, overriding the global output strategy if any- Parameters:
output
- the index of the inputrangeFrom
- lower bound of the target rangerangeTo
- upper bound of the target range- Returns:
- the normalizer
-
getInputStats
public NormalizerStats getInputStats(int input)
Get normalization statistics for a given input.- Parameters:
input
- the index of the input- Returns:
- implementation of NormalizerStats corresponding to the normalization strategy selected
-
getOutputStats
public NormalizerStats getOutputStats(int output)
Get normalization statistics for a given output.- Parameters:
output
- the index of the output- Returns:
- implementation of NormalizerStats corresponding to the normalization strategy selected
-
getInputStats
public Map<Integer,NormalizerStats> getInputStats()
Get the map of normalization statistics per input- Returns:
- map of input indices pointing to NormalizerStats instances
-
getOutputStats
public Map<Integer,NormalizerStats> getOutputStats()
Get the map of normalization statistics per output- Returns:
- map of output indices pointing to NormalizerStats instances
-
fit
public void fit(@NonNull @NonNull MultiDataSet dataSet)
Fit a MultiDataSet (only compute based on the statistics from this dataset)- Specified by:
fit
in interfaceNormalizer<MultiDataSet>
- Parameters:
dataSet
- the dataset to compute on
-
fit
public void fit(@NonNull @NonNull MultiDataSetIterator iterator)
Iterates over a dataset accumulating statistics for normalization- Specified by:
fit
in interfaceMultiDataNormalization
- Parameters:
iterator
- the iterator to use for collecting statistics
-
transform
public void transform(@NonNull @NonNull MultiDataSet data)
Transform the dataset- Specified by:
transform
in interfaceNormalizer<MultiDataSet>
- Parameters:
data
- the dataset to pre process
-
preProcess
public void preProcess(@NonNull @NonNull MultiDataSet data)
Description copied from interface:MultiDataSetPreProcessor
Preprocess the MultiDataSet- Specified by:
preProcess
in interfaceMultiDataNormalization
- Specified by:
preProcess
in interfaceMultiDataSetPreProcessor
-
revert
public void revert(@NonNull @NonNull MultiDataSet data)
Undo (revert) the normalization applied by this DataNormalization instance (arrays are modified in-place)- Specified by:
revert
in interfaceNormalizer<MultiDataSet>
- Parameters:
data
- MultiDataSet to revert the normalization on
-
getType
public NormalizerType getType()
Description copied from interface:Normalizer
Get the enum opType of this normalizer- Specified by:
getType
in interfaceNormalizer<MultiDataSet>
- Returns:
- the opType
- See Also:
NormalizerSerializerStrategy.getSupportedType()
-
revertFeatures
public void revertFeatures(@NonNull @NonNull INDArray[] features)
Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs array- Specified by:
revertFeatures
in interfaceMultiDataNormalization
- Parameters:
features
- The normalized array of inputs
-
revertFeatures
public void revertFeatures(@NonNull @NonNull INDArray[] features, INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs array- Specified by:
revertFeatures
in interfaceMultiDataNormalization
- Parameters:
features
- The normalized array of inputsmaskArrays
- Optional mask arrays belonging to the inputs
-
revertFeatures
public void revertFeatures(@NonNull @NonNull INDArray[] features, INDArray[] maskArrays, int input)
Undo (revert) the normalization applied by this DataNormalization instance to the features of a particular input- Parameters:
features
- The normalized array of inputsmaskArrays
- Optional mask arrays belonging to the inputsinput
- the index of the input to revert normalization on
-
revertLabels
public void revertLabels(@NonNull @NonNull INDArray[] labels)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs array- Specified by:
revertLabels
in interfaceMultiDataNormalization
- Parameters:
labels
- The normalized array of outputs
-
revertLabels
public void revertLabels(@NonNull @NonNull INDArray[] labels, INDArray[] maskArrays)
Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs array- Specified by:
revertLabels
in interfaceMultiDataNormalization
- Parameters:
labels
- The normalized array of outputsmaskArrays
- Optional mask arrays belonging to the outputs
-
revertLabels
public void revertLabels(@NonNull @NonNull INDArray[] labels, INDArray[] maskArrays, int output)
Undo (revert) the normalization applied by this DataNormalization instance to the labels of a particular output- Parameters:
labels
- The normalized array of outputsmaskArrays
- Optional mask arrays belonging to the outputsoutput
- the index of the output to revert normalization on
-
isFit
protected boolean isFit()
- Specified by:
isFit
in classAbstractNormalizer
-
-