public class NDCNN extends Object
Constructor and Description |
---|
NDCNN() |
Modifier and Type | Method and Description |
---|---|
INDArray |
avgPooling2d(INDArray input,
Pooling2DConfig Pooling2DConfig)
2D Convolution layer operation - average pooling 2d
|
INDArray |
avgPooling3d(INDArray input,
Pooling3DConfig Pooling3DConfig)
3D convolution layer operation - average pooling 3d
|
INDArray |
batchToSpace(INDArray x,
int[] blocks,
int[] croppingTop,
int... croppingBottom)
Convolution 2d layer batch to space operation on 4d input.
Reduces input batch dimension by rearranging data into a larger spatial dimensions |
INDArray |
col2Im(INDArray in,
Conv2DConfig Conv2DConfig)
col2im operation for use in 2D convolution operations.
|
INDArray |
conv1d(INDArray input,
INDArray weights,
Conv1DConfig Conv1DConfig)
Conv1d operation.
|
INDArray |
conv1d(INDArray input,
INDArray weights,
INDArray bias,
Conv1DConfig Conv1DConfig)
Conv1d operation.
|
INDArray |
conv2d(INDArray layerInput,
INDArray weights,
Conv2DConfig Conv2DConfig)
2D Convolution operation with optional bias
|
INDArray |
conv2d(INDArray layerInput,
INDArray weights,
INDArray bias,
Conv2DConfig Conv2DConfig)
2D Convolution operation with optional bias
|
INDArray |
conv3d(INDArray input,
INDArray weights,
Conv3DConfig Conv3DConfig)
Convolution 3D operation with optional bias
|
INDArray |
conv3d(INDArray input,
INDArray weights,
INDArray bias,
Conv3DConfig Conv3DConfig)
Convolution 3D operation with optional bias
|
INDArray |
deconv2d(INDArray layerInput,
INDArray weights,
DeConv2DConfig DeConv2DConfig)
2D deconvolution operation with optional bias
|
INDArray |
deconv2d(INDArray layerInput,
INDArray weights,
INDArray bias,
DeConv2DConfig DeConv2DConfig)
2D deconvolution operation with optional bias
|
INDArray |
deconv3d(INDArray input,
INDArray weights,
DeConv3DConfig DeConv3DConfig)
3D CNN deconvolution operation with or without optional bias
|
INDArray |
deconv3d(INDArray input,
INDArray weights,
INDArray bias,
DeConv3DConfig DeConv3DConfig)
3D CNN deconvolution operation with or without optional bias
|
INDArray |
depthToSpace(INDArray x,
int blockSize,
DataFormat dataFormat)
Convolution 2d layer batch to space operation on 4d input.
Reduces input channels dimension by rearranging data into a larger spatial dimensions Example: if input has shape [mb, 8, 2, 2] and block size is 2, then output size is [mb, 8/(2*2), 2*2, 2*2] = [mb, 2, 4, 4] |
INDArray |
depthWiseConv2d(INDArray layerInput,
INDArray depthWeights,
Conv2DConfig Conv2DConfig)
Depth-wise 2D convolution operation with optional bias
|
INDArray |
depthWiseConv2d(INDArray layerInput,
INDArray depthWeights,
INDArray bias,
Conv2DConfig Conv2DConfig)
Depth-wise 2D convolution operation with optional bias
|
INDArray |
dilation2D(INDArray df,
INDArray weights,
int[] strides,
int[] rates,
boolean isSameMode)
TODO doc string
|
INDArray |
extractImagePatches(INDArray input,
int kH,
int kW,
int sH,
int sW,
int rH,
int rW,
boolean sameMode)
Extract image patches
|
INDArray |
im2Col(INDArray in,
Conv2DConfig Conv2DConfig)
im2col operation for use in 2D convolution operations.
|
INDArray |
localResponseNormalization(INDArray input,
LocalResponseNormalizationConfig LocalResponseNormalizationConfig)
2D convolution layer operation - local response normalization
|
INDArray |
maxPooling2d(INDArray input,
Pooling2DConfig Pooling2DConfig)
2D Convolution layer operation - max pooling 2d
|
INDArray |
maxPooling3d(INDArray input,
Pooling3DConfig Pooling3DConfig)
3D convolution layer operation - max pooling 3d operation.
|
INDArray[] |
maxPoolWithArgmax(INDArray input,
Pooling2DConfig Pooling2DConfig)
2D Convolution layer operation - Max pooling on the input and outputs both max values and indices
|
INDArray |
separableConv2d(INDArray layerInput,
INDArray depthWeights,
INDArray pointWeights,
Conv2DConfig Conv2DConfig)
Separable 2D convolution operation with optional bias
|
INDArray |
separableConv2d(INDArray layerInput,
INDArray depthWeights,
INDArray pointWeights,
INDArray bias,
Conv2DConfig Conv2DConfig)
Separable 2D convolution operation with optional bias
|
INDArray |
spaceToBatch(INDArray x,
int[] blocks,
int[] paddingTop,
int... paddingBottom)
Convolution 2d layer space to batch operation on 4d input.
Increases input batch dimension by rearranging data from spatial dimensions into batch dimension |
INDArray |
spaceToDepth(INDArray x,
int blockSize,
DataFormat dataFormat)
Convolution 2d layer space to depth operation on 4d input.
Increases input channels (reduced spatial dimensions) by rearranging data into a larger channels dimension Example: if input has shape [mb, 2, 4, 4] and block size is 2, then output size is [mb, 8/(2*2), 2*2, 2*2] = [mb, 2, 4, 4] |
INDArray |
upsampling2d(INDArray input,
int scale)
Upsampling layer for 2D inputs.
scale is used for both height and width dimensions. |
INDArray |
upsampling2d(INDArray input,
int scaleH,
int scaleW,
boolean nchw)
2D Convolution layer operation - Upsampling 2d
|
INDArray |
upsampling3d(INDArray input,
boolean ncdhw,
int scaleD,
int scaleH,
int scaleW)
3D Convolution layer operation - Upsampling 3d
|
public INDArray avgPooling2d(INDArray input, Pooling2DConfig Pooling2DConfig)
input
- the input to average pooling 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)Pooling2DConfig
- Configuration Objectpublic INDArray avgPooling3d(INDArray input, Pooling3DConfig Pooling3DConfig)
input
- the input to average pooling 3d operation - 5d activations in NCDHW format
(shape [minibatch, channels, depth, height, width]) or NDHWC format
(shape [minibatch, depth, height, width, channels]) (NUMERIC type)Pooling3DConfig
- Configuration Objectpublic INDArray batchToSpace(INDArray x, int[] blocks, int[] croppingTop, int... croppingBottom)
x
- Input variable. 4d input (NUMERIC type)blocks
- Block size, in the height/width dimension (Size: Exactly(count=2))croppingTop
- (Size: Exactly(count=2))croppingBottom
- (Size: Exactly(count=2))public INDArray col2Im(INDArray in, Conv2DConfig Conv2DConfig)
in
- Input - rank 6 input with shape [minibatch, inputChannels, kernelHeight, kernelWidth, outputHeight, outputWidth] (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray conv1d(INDArray input, INDArray weights, INDArray bias, Conv1DConfig Conv1DConfig)
input
- the inputs to conv1d (NUMERIC type)weights
- weights for conv1d op - rank 3 array with shape [kernelSize, inputChannels, outputChannels] (NUMERIC type)bias
- bias for conv1d op - rank 1 array with shape [outputChannels]. May be null. (NUMERIC type)Conv1DConfig
- Configuration Objectpublic INDArray conv1d(INDArray input, INDArray weights, Conv1DConfig Conv1DConfig)
input
- the inputs to conv1d (NUMERIC type)weights
- weights for conv1d op - rank 3 array with shape [kernelSize, inputChannels, outputChannels] (NUMERIC type)Conv1DConfig
- Configuration Objectpublic INDArray conv2d(INDArray layerInput, INDArray weights, INDArray bias, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format (NUMERIC type)weights
- Weights for the convolution operation. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, outputChannels] (NUMERIC type)bias
- Optional 1D bias array with shape [outputChannels]. May be null. (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray conv2d(INDArray layerInput, INDArray weights, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format (NUMERIC type)weights
- Weights for the convolution operation. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, outputChannels] (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray conv3d(INDArray input, INDArray weights, INDArray bias, Conv3DConfig Conv3DConfig)
input
- the input to average pooling 3d operation - 5d activations in NCDHW format
(shape [minibatch, channels, depth, height, width]) or NDHWC format
(shape [minibatch, depth, height, width, channels]) (NUMERIC type)weights
- Weights for conv3d. Rank 5 with shape [kernelDepth, kernelHeight, kernelWidth, inputChannels, outputChannels]. (NUMERIC type)bias
- Optional 1D bias array with shape [outputChannels]. May be null. (NUMERIC type)Conv3DConfig
- Configuration Objectpublic INDArray conv3d(INDArray input, INDArray weights, Conv3DConfig Conv3DConfig)
input
- the input to average pooling 3d operation - 5d activations in NCDHW format
(shape [minibatch, channels, depth, height, width]) or NDHWC format
(shape [minibatch, depth, height, width, channels]) (NUMERIC type)weights
- Weights for conv3d. Rank 5 with shape [kernelDepth, kernelHeight, kernelWidth, inputChannels, outputChannels]. (NUMERIC type)Conv3DConfig
- Configuration Objectpublic INDArray deconv2d(INDArray layerInput, INDArray weights, INDArray bias, DeConv2DConfig DeConv2DConfig)
layerInput
- the input to deconvolution 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)weights
- Weights for the 2d deconvolution operation. 4 dimensions with format [inputChannels, outputChannels, kernelHeight, kernelWidth] (NUMERIC type)bias
- Optional 1D bias array with shape [outputChannels]. May be null. (NUMERIC type)DeConv2DConfig
- Configuration Objectpublic INDArray deconv2d(INDArray layerInput, INDArray weights, DeConv2DConfig DeConv2DConfig)
layerInput
- the input to deconvolution 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)weights
- Weights for the 2d deconvolution operation. 4 dimensions with format [inputChannels, outputChannels, kernelHeight, kernelWidth] (NUMERIC type)DeConv2DConfig
- Configuration Objectpublic INDArray deconv3d(INDArray input, INDArray weights, INDArray bias, DeConv3DConfig DeConv3DConfig)
input
- Input array - shape [bS, iD, iH, iW, iC] (NDHWC) or [bS, iC, iD, iH, iW] (NCDHW) (NUMERIC type)weights
- Weights array - shape [kD, kH, kW, oC, iC] (NUMERIC type)bias
- Bias array - optional, may be null. If non-null, must have shape [outputChannels] (NUMERIC type)DeConv3DConfig
- Configuration Objectpublic INDArray deconv3d(INDArray input, INDArray weights, DeConv3DConfig DeConv3DConfig)
input
- Input array - shape [bS, iD, iH, iW, iC] (NDHWC) or [bS, iC, iD, iH, iW] (NCDHW) (NUMERIC type)weights
- Weights array - shape [kD, kH, kW, oC, iC] (NUMERIC type)DeConv3DConfig
- Configuration Objectpublic INDArray depthToSpace(INDArray x, int blockSize, DataFormat dataFormat)
x
- the input to depth to space pooling 2d operation - 4d activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)blockSize
- Block size, in the height/width dimensiondataFormat
- Data format: "NCHW" or "NHWC"public INDArray depthWiseConv2d(INDArray layerInput, INDArray depthWeights, INDArray bias, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format (NUMERIC type)depthWeights
- Depth-wise conv2d weights. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, depthMultiplier] (NUMERIC type)bias
- Optional 1D bias array with shape [outputChannels]. May be null. (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray depthWiseConv2d(INDArray layerInput, INDArray depthWeights, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format (NUMERIC type)depthWeights
- Depth-wise conv2d weights. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, depthMultiplier] (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray dilation2D(INDArray df, INDArray weights, int[] strides, int[] rates, boolean isSameMode)
df
- (NUMERIC type)weights
- df (NUMERIC type)strides
- weights (Size: Exactly(count=2))rates
- strides (Size: Exactly(count=2))isSameMode
- isSameModepublic INDArray extractImagePatches(INDArray input, int kH, int kW, int sH, int sW, int rH, int rW, boolean sameMode)
input
- Input array. Must be rank 4, with shape [minibatch, height, width, channels] (NUMERIC type)kH
- Kernel heightkW
- Kernel widthsH
- Stride heightsW
- Stride widthrH
- Rate heightrW
- Rate widthsameMode
- If true: use same mode padding. If falsepublic INDArray im2Col(INDArray in, Conv2DConfig Conv2DConfig)
in
- Input - rank 4 input with shape [minibatch, inputChannels, height, width] (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray localResponseNormalization(INDArray input, LocalResponseNormalizationConfig LocalResponseNormalizationConfig)
input
- the inputs to lrn (NUMERIC type)LocalResponseNormalizationConfig
- Configuration Objectpublic INDArray[] maxPoolWithArgmax(INDArray input, Pooling2DConfig Pooling2DConfig)
input
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)Pooling2DConfig
- Configuration Objectpublic INDArray maxPooling2d(INDArray input, Pooling2DConfig Pooling2DConfig)
input
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)Pooling2DConfig
- Configuration Objectpublic INDArray maxPooling3d(INDArray input, Pooling3DConfig Pooling3DConfig)
input
- the input to average pooling 3d operation - 5d activations in NCDHW format
(shape [minibatch, channels, depth, height, width]) or NDHWC format
(shape [minibatch, depth, height, width, channels]) (NUMERIC type)Pooling3DConfig
- Configuration Objectpublic INDArray separableConv2d(INDArray layerInput, INDArray depthWeights, INDArray pointWeights, INDArray bias, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)depthWeights
- Separable conv2d depth weights. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, depthMultiplier] (NUMERIC type)pointWeights
- Point weights, rank 4 with format [1, 1, inputChannels*depthMultiplier, outputChannels]. May be null (NUMERIC type)bias
- Optional bias, rank 1 with shape [outputChannels]. May be null. (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray separableConv2d(INDArray layerInput, INDArray depthWeights, INDArray pointWeights, Conv2DConfig Conv2DConfig)
layerInput
- the input to max pooling 2d operation - 4d CNN (image) activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)depthWeights
- Separable conv2d depth weights. 4 dimensions with format [kernelHeight, kernelWidth, inputChannels, depthMultiplier] (NUMERIC type)pointWeights
- Point weights, rank 4 with format [1, 1, inputChannels*depthMultiplier, outputChannels]. May be null (NUMERIC type)Conv2DConfig
- Configuration Objectpublic INDArray spaceToBatch(INDArray x, int[] blocks, int[] paddingTop, int... paddingBottom)
x
- Input variable. 4d input (NUMERIC type)blocks
- Block size, in the height/width dimension (Size: Exactly(count=2))paddingTop
- Optional 2d int[] array for padding the result: values [[pad top, pad bottom], [pad left, pad right]] (Size: Exactly(count=2))paddingBottom
- Optional 2d int[] array for padding the result: values [[pad top, pad bottom], [pad left, pad right]] (Size: Exactly(count=2))public INDArray spaceToDepth(INDArray x, int blockSize, DataFormat dataFormat)
x
- the input to depth to space pooling 2d operation - 4d activations in NCHW format
(shape [minibatch, channels, height, width]) or NHWC format (shape [minibatch, height, width, channels]) (NUMERIC type)blockSize
- Block size, in the height/width dimensiondataFormat
- Data format: "NCHW" or "NHWC"public INDArray upsampling2d(INDArray input, int scale)
input
- Input in NCHW format (NUMERIC type)scale
- The scale for both height and width dimensions.public INDArray upsampling2d(INDArray input, int scaleH, int scaleW, boolean nchw)
input
- Input in NCHW format (NUMERIC type)scaleH
- Scale to upsample in height dimensionscaleW
- Scale to upsample in width dimensionnchw
- If true: input is in NCHW (minibatch, channels, height, width) format. False: NHWC formatpublic INDArray upsampling3d(INDArray input, boolean ncdhw, int scaleD, int scaleH, int scaleW)
input
- Input in NCHW format (NUMERIC type)ncdhw
- If true: input is in NCDHW (minibatch, channels, depth, height, width) format. False: NDHWC formatscaleD
- Scale to upsample in depth dimensionscaleH
- Scale to upsample in height dimensionscaleW
- Scale to upsample in width dimensionCopyright © 2020. All rights reserved.