Skip to main content

Convolution3DLayerParams

Struct Convolution3DLayerParams 

Source
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: i32

The number of channels in the output (channelsOut). Must be a positive integer.

§input_channels: i32

The number of channels in the input (channels). Must be a positive integer.

§n_groups: i32

Group 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: i32

Depth of the convolution kernel. Must be a positive integer.

§kernel_height: i32

Height of the convolution kernel. Must be a positive integer.

§kernel_width: i32

Width of the convolution kernel. Must be a positive integer.

§stride_depth: i32

Stride along the depth direction. Must be a positive integer.

§stride_height: i32

Stride along the height direction. Must be a positive integer.

§stride_width: i32

Stride along the width direction. Must be a positive integer.

§dilation_depth: i32

Dilation along the depth direction. Must be a positive integer.

§dilation_height: i32

Dilation along the height direction. Must be a positive integer.

§dilation_width: i32

Dilation along the width direction. Must be a positive integer.

§has_bias: bool

Flag 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: i32

Padding 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: i32

Padding 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: i32

Padding 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: i32

Padding 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: i32

Padding 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: i32

Padding 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: bool

Flag 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

Source

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.

Source

pub fn set_padding_type(&mut self, value: PaddingType)

Sets padding_type to the provided enum value.

Trait Implementations§

Source§

impl Clone for Convolution3DLayerParams

Source§

fn clone(&self) -> Convolution3DLayerParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Convolution3DLayerParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Convolution3DLayerParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for Convolution3DLayerParams

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Convolution3DLayerParams

Source§

fn eq(&self, other: &Convolution3DLayerParams) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Convolution3DLayerParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.