Skip to main content

Conv3dConfig

Struct Conv3dConfig 

Source
pub struct Conv3dConfig {
    pub channels: [usize; 2],
    pub kernel_size: [usize; 3],
    pub stride: [usize; 3],
    pub dilation: [usize; 3],
    pub groups: usize,
    pub padding: PaddingConfig3d,
    pub bias: bool,
    pub initializer: Initializer,
}
Expand description

Configuration to create a 3D convolution layer, using the init function.

Fields§

§channels: [usize; 2]

The number of channels.

§kernel_size: [usize; 3]

The size of the kernel.

§stride: [usize; 3]

The stride of the convolution.

§dilation: [usize; 3]

Spacing between kernel elements.

§groups: usize

Controls the connections between input and output channels.

§padding: PaddingConfig3d

The padding configuration.

§bias: bool

If bias should be added to the output.

§initializer: Initializer

The type of function used to initialize neural network parameters

Implementations§

Source§

impl Conv3dConfig

Source

pub fn new(channels: [usize; 2], kernel_size: [usize; 3]) -> Conv3dConfig

Create a new instance of the config.

§Arguments
§Required Arguments
§channels

The number of channels.

§kernel_size

The size of the kernel.

§Default Arguments
§stride

The stride of the convolution.

  • Defaults to "[1, 1, 1]"
§dilation

Spacing between kernel elements.

  • Defaults to "[1, 1, 1]"
§groups

Controls the connections between input and output channels.

  • Defaults to "1"
§padding

The padding configuration.

  • Defaults to "PaddingConfig3d::Valid"
§bias

If bias should be added to the output.

  • Defaults to true
§initializer

The type of function used to initialize neural network parameters

  • Defaults to "Initializer::KaimingUniform{gain:1.0/num_traits::Float::sqrt(3.0),fan_out_only:false}"
Source§

impl Conv3dConfig

Source

pub fn with_stride(self, stride: [usize; 3]) -> Conv3dConfig

Sets the value for the field stride.

The stride of the convolution.

  • Defaults to "[1, 1, 1]"
Source

pub fn with_dilation(self, dilation: [usize; 3]) -> Conv3dConfig

Sets the value for the field dilation.

Spacing between kernel elements.

  • Defaults to "[1, 1, 1]"
Source

pub fn with_groups(self, groups: usize) -> Conv3dConfig

Sets the value for the field groups.

Controls the connections between input and output channels.

  • Defaults to "1"
Source

pub fn with_padding(self, padding: PaddingConfig3d) -> Conv3dConfig

Sets the value for the field padding.

The padding configuration.

  • Defaults to "PaddingConfig3d::Valid"
Source

pub fn with_bias(self, bias: bool) -> Conv3dConfig

Sets the value for the field bias.

If bias should be added to the output.

  • Defaults to true
Source

pub fn with_initializer(self, initializer: Initializer) -> Conv3dConfig

Sets the value for the field initializer.

The type of function used to initialize neural network parameters

  • Defaults to "Initializer::KaimingUniform{gain:1.0/num_traits::Float::sqrt(3.0),fan_out_only:false}"
Source§

impl Conv3dConfig

Source

pub fn init<B>(&self, device: &<B as BackendTypes>::Device) -> Conv3d<B>
where B: Backend,

Initialize a new conv3d module.

Trait Implementations§

Source§

impl Clone for Conv3dConfig

Source§

fn clone(&self) -> Conv3dConfig

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 Config for Conv3dConfig

Source§

fn save<P>(&self, file: P) -> Result<(), Error>
where P: AsRef<Path>,

Saves the configuration to a file. Read more
Source§

fn load<P>(file: P) -> Result<Self, ConfigError>
where P: AsRef<Path>,

Loads the configuration from a file. Read more
Source§

fn load_binary(data: &[u8]) -> Result<Self, ConfigError>

Loads the configuration from a binary buffer. Read more
Source§

impl Debug for Conv3dConfig

Source§

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

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

impl<'de> Deserialize<'de> for Conv3dConfig

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Conv3dConfig, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Conv3dConfig

Source§

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

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

impl Serialize for Conv3dConfig

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,