Package org.deeplearning4j.preprocessors
Class ReshapePreprocessor
- java.lang.Object
-
- org.deeplearning4j.nn.conf.preprocessor.BaseInputPreProcessor
-
- org.deeplearning4j.preprocessors.ReshapePreprocessor
-
- All Implemented Interfaces:
Serializable,Cloneable,InputPreProcessor
public class ReshapePreprocessor extends BaseInputPreProcessor
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReshapePreprocessor(long[] inputShape, long[] targetShape, boolean hasMiniBatchDimension)ReshapePreprocessor(long[] inputShape, long[] targetShape, boolean hasMiniBatchDimension, DataFormat dataFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description INDArraybackprop(INDArray output, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)Reverse the preProcess during backprop.InputTypegetOutputType(InputType inputType)For a given type of input to this preprocessor, what is the type of the output?INDArraypreProcess(INDArray input, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)Pre preProcess input/activations for a multi layer network-
Methods inherited from class org.deeplearning4j.nn.conf.preprocessor.BaseInputPreProcessor
clone, feedForwardMaskArray
-
-
-
-
Constructor Detail
-
ReshapePreprocessor
public ReshapePreprocessor(long[] inputShape, long[] targetShape, boolean hasMiniBatchDimension)- Parameters:
inputShape- Input shape, with or without leading minibatch dimension, depending on value of hasMiniBatchDimensiontargetShape- Target shape, with or without leading minibatch dimension, depending on value of hasMiniBatchDimensionhasMiniBatchDimension- If true: shapes should be of the form [minibatch, x, y, ...]; if false: shapes should be of form [x, y, ...]
-
ReshapePreprocessor
public ReshapePreprocessor(long[] inputShape, long[] targetShape, boolean hasMiniBatchDimension, DataFormat dataFormat)- Parameters:
inputShape- Input shape, with or without leading minibatch dimension, depending on value of hasMiniBatchDimensiontargetShape- Target shape, with or without leading minibatch dimension, depending on value of hasMiniBatchDimensionhasMiniBatchDimension- If true: shapes should be of the form [minibatch, x, y, ...]; if false: shapes should be of form [x, y, ...]dataFormat- May be null. If non-null:
-
-
Method Detail
-
preProcess
public INDArray preProcess(INDArray input, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)
Description copied from interface:InputPreProcessorPre preProcess input/activations for a multi layer network- Parameters:
input- the input to pre preProcessminiBatchSize- Minibatch sizeworkspaceMgr- Workspace manager- Returns:
- the processed input. Note that the returned array should be placed in the
ArrayType.ACTIVATIONSworkspace via the workspace manager
-
backprop
public INDArray backprop(INDArray output, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)
Description copied from interface:InputPreProcessorReverse the preProcess during backprop. Process Gradient/epsilons before passing them to the layer below.- Parameters:
output- which is a pair of the gradient and epsilonminiBatchSize- Minibatch sizeworkspaceMgr- Workspace manager- Returns:
- the reverse of the pre preProcess step (if any). Note that the returned array should be
placed in
ArrayType.ACTIVATION_GRADworkspace via the workspace manager
-
getOutputType
public InputType getOutputType(InputType inputType) throws InvalidInputTypeException
Description copied from interface:InputPreProcessorFor a given type of input to this preprocessor, what is the type of the output?- Parameters:
inputType- Type of input for the preprocessor- Returns:
- Type of input after applying the preprocessor
- Throws:
InvalidInputTypeException
-
-