Class InputType
- java.lang.Object
-
- org.deeplearning4j.nn.conf.inputs.InputType
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InputType.InputTypeConvolutional,InputType.InputTypeConvolutional3D,InputType.InputTypeConvolutionalFlat,InputType.InputTypeFeedForward,InputType.InputTypeRecurrent
public abstract class InputType extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInputType.InputTypeConvolutionalstatic classInputType.InputTypeConvolutional3Dstatic classInputType.InputTypeConvolutionalFlatstatic classInputType.InputTypeFeedForwardstatic classInputType.InputTypeRecurrentstatic classInputType.TypeThe type of activations in/out of a given GraphVertex
FF: Standard feed-foward (2d minibatch, 1d per example) data
RNN: Recurrent neural network (3d minibatch) time series data
CNN: 2D Convolutional neural network (4d minibatch, [miniBatchSize, channels, height, width]) CNNFlat: Flattened 2D conv net data (2d minibatch, [miniBatchSize, height * width * channels]) CNN3D: 3D convolutional neural network (5d minibatch, [miniBatchSize, channels, height, width, channels])
-
Constructor Summary
Constructors Constructor Description InputType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract longarrayElementsPerExample()static InputTypeconvolutional(long height, long width, long depth)Input type for convolutional (CNN) data, that is 4d with shape [miniBatchSize, channels, height, width].static InputTypeconvolutional(long height, long width, long depth, CNN2DFormat format)static InputTypeconvolutional3D(long depth, long height, long width, long channels)static InputTypeconvolutional3D(Convolution3D.DataFormat dataFormat, long depth, long height, long width, long channels)Input type for 3D convolutional (CNN3D) 5d data:
If NDHWC format [miniBatchSize, depth, height, width, channels]
If NDCWHstatic InputTypeconvolutionalFlat(long height, long width, long depth)Input type for convolutional (CNN) data, where the data is in flattened (row vector) format.static InputTypefeedForward(long size)InputType for feed forward network datastatic InputTypefeedForward(long size, DataFormat timeDistributedFormat)static CNN2DFormatgetDefaultCNN2DFormat()long[]getShape()Returns the shape of this InputType without minibatch dimension in the returned arrayabstract long[]getShape(boolean includeBatchDim)Returns the shape of this InputTypeabstract InputType.TypegetType()static InputTypeinferInputType(INDArray inputArray)static InputType[]inferInputTypes(INDArray... inputArrays)static InputTyperecurrent(long size)InputType for recurrent neural network (time series) datastatic InputTyperecurrent(long size, long timeSeriesLength)InputType for recurrent neural network (time series) datastatic InputTyperecurrent(long size, long timeSeriesLength, RNNFormat format)static InputTyperecurrent(long size, RNNFormat format)static voidsetDefaultCNN2DFormat(CNN2DFormat defaultCNN2DFormat)abstract StringtoString()
-
-
-
Method Detail
-
getDefaultCNN2DFormat
public static CNN2DFormat getDefaultCNN2DFormat()
-
setDefaultCNN2DFormat
public static void setDefaultCNN2DFormat(CNN2DFormat defaultCNN2DFormat)
-
getType
public abstract InputType.Type getType()
-
arrayElementsPerExample
public abstract long arrayElementsPerExample()
-
getShape
public abstract long[] getShape(boolean includeBatchDim)
Returns the shape of this InputType- Parameters:
includeBatchDim- Whether to include minibatch in the return shape array- Returns:
- int[]
-
getShape
public long[] getShape()
Returns the shape of this InputType without minibatch dimension in the returned array- Returns:
- int[]
-
feedForward
public static InputType feedForward(long size)
InputType for feed forward network data- Parameters:
size- The size of the activations- Returns:
- InputTypeFeedForward
-
feedForward
public static InputType feedForward(long size, DataFormat timeDistributedFormat)
-
recurrent
public static InputType recurrent(long size)
InputType for recurrent neural network (time series) data- Parameters:
size- The size of the activations- Returns:
- InputTypeRecurrent
-
recurrent
public static InputType recurrent(long size, long timeSeriesLength)
InputType for recurrent neural network (time series) data- Parameters:
size- The size of the activationstimeSeriesLength- Length of the input time series- Returns:
- InputTypeRecurrent
-
convolutional
public static InputType convolutional(long height, long width, long depth)
Input type for convolutional (CNN) data, that is 4d with shape [miniBatchSize, channels, height, width]. For CNN data that has been flattened, useconvolutionalFlat(long, long, long)- Parameters:
height- height of the inputwidth- Width of the inputdepth- Depth, or number of channels- Returns:
- InputTypeConvolutional
-
convolutional
public static InputType convolutional(long height, long width, long depth, CNN2DFormat format)
-
convolutional3D
@Deprecated public static InputType convolutional3D(long depth, long height, long width, long channels)
Input type for 3D convolutional (CNN3D) data in NDHWC format, that is 5d with shape [miniBatchSize, depth, height, width, channels].- Parameters:
height- height of the inputwidth- Width of the inputdepth- Depth of the inputchannels- Number of channels of the input- Returns:
- InputTypeConvolutional3D
-
convolutional3D
public static InputType convolutional3D(Convolution3D.DataFormat dataFormat, long depth, long height, long width, long channels)
Input type for 3D convolutional (CNN3D) 5d data:
If NDHWC format [miniBatchSize, depth, height, width, channels]
If NDCWH- Parameters:
height- height of the inputwidth- Width of the inputdepth- Depth of the inputchannels- Number of channels of the input- Returns:
- InputTypeConvolutional3D
-
convolutionalFlat
public static InputType convolutionalFlat(long height, long width, long depth)
Input type for convolutional (CNN) data, where the data is in flattened (row vector) format. Expect data with shape [miniBatchSize, height * width * channels]. For CNN data in 4d format, useconvolutional(long, long, long)- Parameters:
height- Height of the (unflattened) data represented by this input typewidth- Width of the (unflattened) data represented by this input typedepth- Depth of the (unflattened) data represented by this input type- Returns:
- InputTypeConvolutionalFlat
-
-