Struct burn_core::nn::conv::Conv2dConfig
source · pub struct Conv2dConfig {
pub channels: [usize; 2],
pub kernel_size: [usize; 2],
pub stride: [usize; 2],
pub dilation: [usize; 2],
pub groups: usize,
pub padding: PaddingConfig2d,
pub bias: bool,
pub initializer: Initializer,
}Expand description
Configuration to create an 2D convolution layer.
Fields§
§channels: [usize; 2]The number of channels.
kernel_size: [usize; 2]The size of the kernel.
stride: [usize; 2]The stride of the convolution.
dilation: [usize; 2]Spacing between kernel elements.
groups: usizeControls the connections between input and output channels.
padding: PaddingConfig2dThe padding configuration.
bias: boolIf bias should be added to the output.
initializer: InitializerThe type of function used to initialize neural network parameters
Implementations§
source§impl Conv2dConfig
impl Conv2dConfig
source§impl Conv2dConfig
impl Conv2dConfig
sourcepub fn with_stride(self, stride: [usize; 2]) -> Self
pub fn with_stride(self, stride: [usize; 2]) -> Self
The stride of the convolution.
sourcepub fn with_dilation(self, dilation: [usize; 2]) -> Self
pub fn with_dilation(self, dilation: [usize; 2]) -> Self
Spacing between kernel elements.
sourcepub fn with_groups(self, groups: usize) -> Self
pub fn with_groups(self, groups: usize) -> Self
Controls the connections between input and output channels.
sourcepub fn with_padding(self, padding: PaddingConfig2d) -> Self
pub fn with_padding(self, padding: PaddingConfig2d) -> Self
The padding configuration.
sourcepub fn with_initializer(self, initializer: Initializer) -> Self
pub fn with_initializer(self, initializer: Initializer) -> Self
The type of function used to initialize neural network parameters
Trait Implementations§
source§impl Clone for Conv2dConfig
impl Clone for Conv2dConfig
source§impl Config for Conv2dConfig
impl Config for Conv2dConfig
source§fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
Saves the configuration to a file. Read more
source§fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
source§impl Debug for Conv2dConfig
impl Debug for Conv2dConfig
source§impl<'de> Deserialize<'de> for Conv2dConfig
impl<'de> Deserialize<'de> for Conv2dConfig
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Conv2dConfig
impl Display for Conv2dConfig
Auto Trait Implementations§
impl RefUnwindSafe for Conv2dConfig
impl Send for Conv2dConfig
impl Sync for Conv2dConfig
impl Unpin for Conv2dConfig
impl UnwindSafe for Conv2dConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more