public class CnnToFeedForwardPreProcessor extends Object implements InputPreProcessor
CNN2DFormat.NCHW format activations) or shape
[numExamples, inputHeight, inputWidth, numChannels] (for CNN2DFormat.NHWC) format activations) into 2d activations
(with shape [numExamples, inputHeight*inputWidth*numChannels]) for use in feed forward layer.
(a) Reshapes epsilons (weights*deltas) out of FeedFoward layer (which is 2D or 3D with shape
[numExamples, inputHeight*inputWidth*numChannels]) into 4d epsilons (with shape
[numExamples, numChannels, inputHeight, inputWidth] or [numExamples, inputHeight, inputWidth, numChannels]) suitable to
feed into CNN layers.for opposite case (i.e., DenseLayer -> CNNetc),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected CNN2DFormat |
format |
protected long |
inputHeight |
protected long |
inputWidth |
protected long |
numChannels |
| Constructor and Description |
|---|
CnnToFeedForwardPreProcessor() |
CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth) |
CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth,
long numChannels) |
CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth,
long numChannels,
CNN2DFormat format) |
| Modifier and Type | Method and Description |
|---|---|
INDArray |
backprop(INDArray epsilons,
int miniBatchSize,
LayerWorkspaceMgr workspaceMgr)
Reverse the preProcess during backprop.
|
CnnToFeedForwardPreProcessor |
clone() |
Pair<INDArray,MaskState> |
feedForwardMaskArray(INDArray maskArray,
MaskState currentMaskState,
int minibatchSize) |
InputType |
getOutputType(InputType inputType)
For a given type of input to this preprocessor, what is the type of the output?
|
INDArray |
preProcess(INDArray input,
int miniBatchSize,
LayerWorkspaceMgr workspaceMgr)
Pre preProcess input/activations for a multi layer network
|
protected long inputHeight
protected long inputWidth
protected long numChannels
protected CNN2DFormat format
public CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth,
long numChannels,
CNN2DFormat format)
inputHeight - the columnsinputWidth - the rowsnumChannels - the channelspublic CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth)
public CnnToFeedForwardPreProcessor(long inputHeight,
long inputWidth,
long numChannels)
public CnnToFeedForwardPreProcessor()
public INDArray preProcess(INDArray input, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)
InputPreProcessorpreProcess in interface InputPreProcessorinput - the input to pre preProcessminiBatchSize - Minibatch sizeworkspaceMgr - Workspace managerArrayType.ACTIVATIONS workspace via the workspace managerpublic INDArray backprop(INDArray epsilons, int miniBatchSize, LayerWorkspaceMgr workspaceMgr)
InputPreProcessorbackprop in interface InputPreProcessorepsilons - which is a pair of the gradient and epsilonminiBatchSize - Minibatch sizeworkspaceMgr - Workspace managerArrayType.ACTIVATION_GRAD workspace via the
workspace managerpublic CnnToFeedForwardPreProcessor clone()
clone in interface InputPreProcessorclone in class Objectpublic InputType getOutputType(InputType inputType)
InputPreProcessorgetOutputType in interface InputPreProcessorinputType - Type of input for the preprocessorpublic Pair<INDArray,MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize)
feedForwardMaskArray in interface InputPreProcessorCopyright © 2020. All rights reserved.