Package org.deeplearning4j.util
Class Convolution3DUtils
- java.lang.Object
-
- org.deeplearning4j.util.Convolution3DUtils
-
public class Convolution3DUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 configurationstatic int[]
get3DSameModeTopLeftPadding(int[] outSize, int[] inSize, int[] kernel, int[] strides, int[] dilation)
Get top and left padding for same mode only for 3d convolutionsstatic Convolution3D.DataFormat
getFormatForLayer(Layer inputLayer)
Returns theConvolution3D.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.
-
-
-
Method Detail
-
get3DOutputSize
public 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- Parameters:
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)- Returns:
- Output size: int[3] with output depth/height/width
-
get3DSameModeTopLeftPadding
public 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- Parameters:
outSize
-inSize
-kernel
-strides
-- Returns:
-
validateCnn3DKernelStridePadding
public static void validateCnn3DKernelStridePadding(int[] kernelSize, int[] stride, int[] padding)
Perform validation on the CNN3D layer kernel/stride/padding. Expect 3d int[], with values > 0 for kernel size and stride, and values >= 0 for padding.- Parameters:
kernelSize
- Kernel size array to checkstride
- Stride array to checkpadding
- Padding array to check
-
getFormatForLayer
public static Convolution3D.DataFormat getFormatForLayer(Layer inputLayer)
Returns theConvolution3D.DataFormat
for the associated layer. Note thatlayerHasConvolution3DLayout(Layer)
should return true on the given layer input or anIllegalArgumentException
will be thrown- Parameters:
inputLayer
- the input layer to get the format for- Returns:
- the associated
Convolution3D.DataFormat
with the layer
-
layerHasConvolution3DLayout
public static boolean layerHasConvolution3DLayout(Layer layer)
Returns true if any of the layers are 3d convolution, pooling, or upsampling layers including:Convolution3D
,Deconvolution3D
,Subsampling3DLayer
,Upsampling3D
- Parameters:
layer
- the input layer to validate- Returns:
- true if the layer is any of the types specified.
-
-