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 voidfit(@NonNull MultiDataSetIterator iterator)Iterates over a dataset accumulating statistics for normalizationvoidfit(@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 inputNormalizerStatsgetInputStats(int input)Get normalization statistics for a given input.Map<Integer,NormalizerStats>getOutputStats()Get the map of normalization statistics per outputNormalizerStatsgetOutputStats(int output)Get normalization statistics for a given output.NormalizerTypegetType()Get the enum opType of this normalizerprotected booleanisFit()MultiNormalizerHybridminMaxScaleAllInputs()Apply min-max scaling to all inputs, except the ones individually configuredMultiNormalizerHybridminMaxScaleAllInputs(double rangeFrom, double rangeTo)Apply min-max scaling to all inputs, except the ones individually configuredMultiNormalizerHybridminMaxScaleAllOutputs()Apply min-max scaling to all outputs, except the ones individually configuredMultiNormalizerHybridminMaxScaleAllOutputs(double rangeFrom, double rangeTo)Apply min-max scaling to all outputs, except the ones individually configuredMultiNormalizerHybridminMaxScaleInput(int input)Apply min-max scaling to a specific input, overriding the global input strategy if anyMultiNormalizerHybridminMaxScaleInput(int input, double rangeFrom, double rangeTo)Apply min-max scaling to a specific input, overriding the global input strategy if anyMultiNormalizerHybridminMaxScaleOutput(int output)Apply min-max scaling to a specific output, overriding the global output strategy if anyMultiNormalizerHybridminMaxScaleOutput(int output, double rangeFrom, double rangeTo)Apply min-max scaling to a specific output, overriding the global output strategy if anyvoidpreProcess(@NonNull MultiDataSet data)Preprocess the MultiDataSetvoidrevert(@NonNull MultiDataSet data)Undo (revert) the normalization applied by this DataNormalization instance (arrays are modified in-place)voidrevertFeatures(@NonNull INDArray[] features)Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs arrayvoidrevertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays)Undo (revert) the normalization applied by this DataNormalization instance to the entire inputs arrayvoidrevertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays, int input)Undo (revert) the normalization applied by this DataNormalization instance to the features of a particular inputvoidrevertLabels(@NonNull INDArray[] labels)Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs arrayvoidrevertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays)Undo (revert) the normalization applied by this DataNormalization instance to the entire outputs arrayvoidrevertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays, int output)Undo (revert) the normalization applied by this DataNormalization instance to the labels of a particular outputMultiNormalizerHybridstandardizeAllInputs()Apply standardization to all inputs, except the ones individually configuredMultiNormalizerHybridstandardizeAllOutputs()Apply standardization to all outputs, except the ones individually configuredMultiNormalizerHybridstandardizeInput(int input)Apply standardization to a specific input, overriding the global input strategy if anyMultiNormalizerHybridstandardizeOutput(int output)Apply standardization to a specific output, overriding the global output strategy if anyvoidtransform(@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:
fitin 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:
fitin interfaceMultiDataNormalization- Parameters:
iterator- the iterator to use for collecting statistics
-
transform
public void transform(@NonNull @NonNull MultiDataSet data)Transform the dataset- Specified by:
transformin interfaceNormalizer<MultiDataSet>- Parameters:
data- the dataset to pre process
-
preProcess
public void preProcess(@NonNull @NonNull MultiDataSet data)Description copied from interface:MultiDataSetPreProcessorPreprocess the MultiDataSet- Specified by:
preProcessin interfaceMultiDataNormalization- Specified by:
preProcessin 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:
revertin interfaceNormalizer<MultiDataSet>- Parameters:
data- MultiDataSet to revert the normalization on
-
getType
public NormalizerType getType()
Description copied from interface:NormalizerGet the enum opType of this normalizer- Specified by:
getTypein 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:
revertFeaturesin 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:
revertFeaturesin 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:
revertLabelsin 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:
revertLabelsin 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:
isFitin classAbstractNormalizer
-
-