public class Conv3D extends Convolution
Conv3D
layer behaves just as Convolution
does, with the distinction being it
operates of 3-dimensional data such as medical images or video data. The traversal of each filter
begins from LayoutType.WIDTH
then to LayoutType.HEIGHT
, and lastly across each
LayoutType.DEPTH
in the specified depth
size of the data.
The utilization of Conv3D
layer allows deeper analysis of visual data such as those in
medical images, or even analysis on temporal data such as video data as a whole instead of
processing each frame with a Conv2D
layer, despite this being a common practice in
computer vision researches. The benefit of utilizing this kind of layer is the maintaining of
serial data across 2-dimensional data, hence could be beneficial for research focus on such as
object tracking. The drawback is that this kind of layer is more costly compared to other
convolution layer types since dot product operation is performed on all three dimensions.
The input to a Conv3D
is an NDList
with a single 5-D NDArray
. The layout of the NDArray
must be "NCDHW". The
shapes are
data: (batch_size, channel, depth, height, width)
weight: (num_filter, channel, kernel[0], kernel[1], kernel[2])
bias: (num_filter,)
out: (batch_size, num_filter, out_depth, out_height, out_width)
out_depth = f(depth, kernel[0], pad[0], stride[0], dilate[0])
out_height = f(height, kernel[1], pad[1], stride[1], dilate[1])
out_width = f(width, kernel[2], pad[2], stride[2], dilate[2])
where f(x, k, p, s, d) = floor((x + 2 * p - d * (k - 1) - 1)/s) + 1
Both weight
and bias
are learn-able parameters.
Modifier and Type | Class and Description |
---|---|
static class |
Conv3D.Builder
|
Convolution.ConvolutionBuilder<T extends Convolution.ConvolutionBuilder>
bias, dilate, includeBias, kernel, numFilters, numGroups, pad, stride, weight
inputNames, inputShapes
Modifier and Type | Method and Description |
---|---|
static Conv3D.Builder |
builder()
Creates a builder to build a
Conv3D . |
protected LayoutType[] |
getExpectedLayout()
Returns the expected layout of the input.
|
protected java.lang.String |
getStringLayout()
Returns the string representing the layout of the input.
|
protected int |
numDimensions()
Returns the number of dimensions of the input.
|
beforeInitialize, forward, getDirectParameters, getOutputShapes, getParameterShape, loadParameters, saveParameters
getChildren, initialize, toString
cast, clear, describeInput, getParameters, isInitialized, readInputShapes, saveInputShapes, setInitializer, setInitializer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forward, validateLayout
protected LayoutType[] getExpectedLayout()
getExpectedLayout
in class Convolution
protected java.lang.String getStringLayout()
getStringLayout
in class Convolution
protected int numDimensions()
numDimensions
in class Convolution
public static Conv3D.Builder builder()
Conv3D
.