pub struct ConvNextConfig {
pub channels: usize,
pub height: usize,
pub width: usize,
pub kernel: usize,
pub expansion: usize,
pub layer_scale_init: f32,
}Expand description
Configuration for a single ConvNeXt block.
Fields§
§channels: usizeNumber of feature channels C (input == output).
height: usizeSpatial height H in pixels.
width: usizeSpatial width W in pixels.
kernel: usizeDepthwise convolution kernel edge length (must be odd, e.g. 7).
expansion: usizeInverted-bottleneck expansion factor (hidden = expansion · C).
layer_scale_init: f32Initial value for the layer-scale gamma (e.g. 1e-6).
Implementations§
Source§impl ConvNextConfig
impl ConvNextConfig
Sourcepub fn new(
channels: usize,
height: usize,
width: usize,
kernel: usize,
expansion: usize,
layer_scale_init: f32,
) -> VisionResult<Self>
pub fn new( channels: usize, height: usize, width: usize, kernel: usize, expansion: usize, layer_scale_init: f32, ) -> VisionResult<Self>
Create and validate a ConvNextConfig.
§Errors
channels == 0/height == 0/width == 0→InvalidImageSizekernel == 0orkerneleven →InvalidPatchSizeexpansion == 0→Internal
Inverted-bottleneck hidden width expansion · C.
Trait Implementations§
Source§impl Clone for ConvNextConfig
impl Clone for ConvNextConfig
Source§fn clone(&self) -> ConvNextConfig
fn clone(&self) -> ConvNextConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConvNextConfig
impl Debug for ConvNextConfig
Source§impl PartialEq for ConvNextConfig
impl PartialEq for ConvNextConfig
Source§fn eq(&self, other: &ConvNextConfig) -> bool
fn eq(&self, other: &ConvNextConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConvNextConfig
Auto Trait Implementations§
impl Freeze for ConvNextConfig
impl RefUnwindSafe for ConvNextConfig
impl Send for ConvNextConfig
impl Sync for ConvNextConfig
impl Unpin for ConvNextConfig
impl UnsafeUnpin for ConvNextConfig
impl UnwindSafe for ConvNextConfig
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