public class Convolution3DUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int[] |
get3DOutputSize(INDArray inputData,
int[] kernel,
int[] strides,
int[] padding,
ConvolutionMode convolutionMode,
int[] dilation,
boolean isNCDHW)
Get the output size (depth/height/width) for the given input data and CNN3D configuration
|
static int[] |
get3DSameModeTopLeftPadding(int[] outSize,
int[] inSize,
int[] kernel,
int[] strides,
int[] dilation)
Get top and left padding for same mode only for 3d convolutions
|
static Convolution3D.DataFormat |
getFormatForLayer(Layer inputLayer)
Returns the
Convolution3D.DataFormat
for the associated layer. |
static boolean |
layerHasConvolution3DLayout(Layer layer)
Returns true if any of the layers are 3d convolution, pooling, or upsampling layers including:
Convolution3D , Deconvolution3D , Subsampling3DLayer , Upsampling3D |
static void |
validateCnn3DKernelStridePadding(int[] kernelSize,
int[] stride,
int[] padding)
Perform validation on the CNN3D layer kernel/stride/padding.
|
public static int[] get3DOutputSize(INDArray inputData, int[] kernel, int[] strides, int[] padding, ConvolutionMode convolutionMode, int[] dilation, boolean isNCDHW)
inputData
- Input datakernel
- Kernel size (depth/height/width)strides
- Strides (depth/height/width)padding
- Padding (depth/height/width)convolutionMode
- Convolution mode (Same, Strict, Truncate)dilation
- Kernel dilation (depth/height/width)public static int[] get3DSameModeTopLeftPadding(int[] outSize, int[] inSize, int[] kernel, int[] strides, int[] dilation)
outSize
- inSize
- kernel
- strides
- public static void validateCnn3DKernelStridePadding(int[] kernelSize, int[] stride, int[] padding)
kernelSize
- Kernel size array to checkstride
- Stride array to checkpadding
- Padding array to checkpublic static Convolution3D.DataFormat getFormatForLayer(Layer inputLayer)
Convolution3D.DataFormat
for the associated layer.
Note that layerHasConvolution3DLayout(Layer)
should return true on the given layer input or an IllegalArgumentException
will be throwninputLayer
- the input layer to get the format forConvolution3D.DataFormat
with
the layerpublic static boolean layerHasConvolution3DLayout(Layer layer)
Convolution3D
, Deconvolution3D
, Subsampling3DLayer
, Upsampling3D
layer
- the input layer to validateCopyright © 2022. All rights reserved.