pub struct Conv1D { /* private fields */ }Expand description
1D convolution over inputs shaped (batch, in_channels, length).
Implementations§
Source§impl Conv1D
impl Conv1D
Sourcepub fn new(
in_channels: usize,
filters: usize,
kernel_size: usize,
activation: &str,
) -> Self
pub fn new( in_channels: usize, filters: usize, kernel_size: usize, activation: &str, ) -> Self
Create a 1D convolution with filters output channels and kernel_size.
Sourcepub fn with_stride(self, stride: usize) -> Self
pub fn with_stride(self, stride: usize) -> Self
Builder: set the stride (default 1).
Sourcepub fn with_dilation(self, dilation: usize) -> Self
pub fn with_dilation(self, dilation: usize) -> Self
Builder: set the dilation (default 1).
Sourcepub fn with_padding(self, padding: Padding) -> Self
pub fn with_padding(self, padding: Padding) -> Self
Builder: set the padding strategy (default Padding::Valid).
Trait Implementations§
Source§impl Layer for Conv1D
impl Layer for Conv1D
Source§fn build(&mut self, vb: VarBuilder<'_>) -> Result<()>
fn build(&mut self, vb: VarBuilder<'_>) -> Result<()>
Create this layer’s trainable parameters into
vb, which is already
scoped (name-prefixed) to the layer. Stateless layers (e.g. Flatten,
pooling) implement this as a no-op.Auto Trait Implementations§
impl !RefUnwindSafe for Conv1D
impl !UnwindSafe for Conv1D
impl Forget for Conv1D
impl Freeze for Conv1D
impl Move for Conv1D
impl Send for Conv1D
impl Sync for Conv1D
impl Unpin for Conv1D
impl UnsafeUnpin for Conv1D
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more