pub struct Convolution3DLayerParams {Show 24 fields
pub output_channels: i32,
pub input_channels: i32,
pub n_groups: i32,
pub kernel_depth: i32,
pub kernel_height: i32,
pub kernel_width: i32,
pub stride_depth: i32,
pub stride_height: i32,
pub stride_width: i32,
pub dilation_depth: i32,
pub dilation_height: i32,
pub dilation_width: i32,
pub has_bias: bool,
pub weights: Option<WeightParams>,
pub bias: Option<WeightParams>,
pub padding_type: i32,
pub custom_padding_front: i32,
pub custom_padding_back: i32,
pub custom_padding_top: i32,
pub custom_padding_bottom: i32,
pub custom_padding_left: i32,
pub custom_padding_right: i32,
pub is_deconvolution: bool,
pub output_shape: Vec<u64>,
}Expand description
A layer that performs a 3-dimensional convolution.
.. code::
y = Convolution3DLayer(x)Input
A blob of rank 5.
The input blob’s shape should be \[batch, channels, depth, height, width\].
Fields
The bias field, if set, should have shape of \[channelsOut\].
Output
A blob of rank 5.
The output blob’s shape is \[batch, channelsOut, depthOut, heightOut, widthOut\].
Type of padding can be custom, valid, or same. Padded values are all zeros.
Output spatial dimensions depend on the the type of padding. For details, refer to the
descriptions of the PaddingType field of this Convolution3DLayerParams message.
Example
For example, given an input of size \[1, 3, 3, 8, 8\], a stride of 2 in each dimension,
a kernel of 3 in each dimension, 2 output channels, and same padding, this layer will
compute the total padding applied in the depth, height, and width dimensions to be 2, 1, and 1,
respectively. The depth padding is even and will be applied equally to both sides of the depth
dimension. Since the height and width padding values are odd, they’ll be applied to the
bottom/right of the height/width dimensions. Thus, the padding applied to the input will be
\[1, 1, 0, 1, 0, 1\] (front, back, top, bottom, left, right). Finally, the output produced
will have size \[1, 2, 2, 4, 4\].
Fields§
§output_channels: i32The number of channels in the output (channelsOut). Must be a positive integer.
input_channels: i32The number of channels in the input (channels). Must be a positive integer.
n_groups: i32Group convolution, i.e., weight reuse along the channel axis. It must evenly divide both the number of input and output channels and be at most the number of input channels (a depthwise convolution). Input and kernels are divided into g groups and convolution is applied within the groups independently.
kernel_depth: i32Depth of the convolution kernel. Must be a positive integer.
kernel_height: i32Height of the convolution kernel. Must be a positive integer.
kernel_width: i32Width of the convolution kernel. Must be a positive integer.
stride_depth: i32Stride along the depth direction. Must be a positive integer.
stride_height: i32Stride along the height direction. Must be a positive integer.
stride_width: i32Stride along the width direction. Must be a positive integer.
dilation_depth: i32Dilation along the depth direction. Must be a positive integer.
dilation_height: i32Dilation along the height direction. Must be a positive integer.
dilation_width: i32Dilation along the width direction. Must be a positive integer.
has_bias: boolFlag to specify whether a bias is to be added or not. If false, then no bias is added.
weights: Option<WeightParams>Weights associated with this layer.
Weights have the shape
if deconvolution == False
\[outputChannels, kernelChannels, kernelDepth, kernelHeight, kernelWidth\], where
kernelChannels == inputChannels / nGroups
else if deconvolution == True
\[outputChannels / nGroups, kernelChannels, kernelDepth, kernelHeight, kernelWidth\], where
bias: Option<WeightParams>Must be of size \[outputChannels\].
padding_type: i32§custom_padding_front: i32Padding before the input in the depth direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
custom_padding_back: i32Padding after the input in the depth direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
custom_padding_top: i32Padding before the input in the height direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
custom_padding_bottom: i32Padding after the input in the height direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
custom_padding_left: i32Padding before the input in the width direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
custom_padding_right: i32Padding after the input in the width direction. Must be zero or a positive integer.
Used when the PaddingType is CustomPadding, otherwise ignored by other padding types.
is_deconvolution: boolFlag to specify if this is Convolution Transpose or not.
output_shape: Vec<u64>The output shape, which has length 3 \[D_out, H_out, W_out\].
This is used only for deconvolution (isDeconvolution == true).
If not set, the deconvolution output shape is calculated
based on PaddingType.
Implementations§
Source§impl Convolution3DLayerParams
impl Convolution3DLayerParams
Sourcepub fn padding_type(&self) -> PaddingType
pub fn padding_type(&self) -> PaddingType
Returns the enum value of padding_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_padding_type(&mut self, value: PaddingType)
pub fn set_padding_type(&mut self, value: PaddingType)
Sets padding_type to the provided enum value.
Trait Implementations§
Source§impl Clone for Convolution3DLayerParams
impl Clone for Convolution3DLayerParams
Source§fn clone(&self) -> Convolution3DLayerParams
fn clone(&self) -> Convolution3DLayerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Convolution3DLayerParams
impl Debug for Convolution3DLayerParams
Source§impl Default for Convolution3DLayerParams
impl Default for Convolution3DLayerParams
Source§impl Message for Convolution3DLayerParams
impl Message for Convolution3DLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for Convolution3DLayerParams
impl PartialEq for Convolution3DLayerParams
Source§fn eq(&self, other: &Convolution3DLayerParams) -> bool
fn eq(&self, other: &Convolution3DLayerParams) -> bool
self and other values to be equal, and is used by ==.