Struct neuronika::nn::Conv1d [−][src]
pub struct Conv1d<Pad: PaddingMode> {
pub padding: usize,
pub padding_mode: Pad,
pub stride: usize,
pub dilation: usize,
pub weight: Learnable<Ix3>,
pub bias: Learnable<Ix1>,
}
Expand description
Applies a temporal convolution over an input signal composed of several input planes.
See also GroupedConv1d
.
Fields
padding: usize
padding_mode: Pad
stride: usize
dilation: usize
weight: Learnable<Ix3>
bias: Learnable<Ix1>
Implementations
Creates a new Conv1d.
Arguments
-
in_channels
- number of planes in the input signal. -
out_channels
- number of planes in the output signal. -
kernel_size
- size of the kernel, a number for this one-dimensional case. -
padding
- padding to be applied to the input, a number for this one-dimensional case. -
padding_mode
- padding mode, it can be:Zero
,Constant
,Reflective
orReplicative
. -
stride
- stride of the convolution, a number for this one-dimensional case. -
dilation
- controls the spacing between the kernel points, a number for this one-dimensional case.
The weight and the bias of the layer are initialized from U(-k, k) where
k = (1. /(in_channels * kernel_size) as f32).sqrt()
.
Computes a 1-dimensional convolution (cross correlation).
Arguments
input
- signal to convolve.
The input must be of shape (N, Cin, L)
- N is the batch size
- Cin is the number of input channels
- L is the length of the input
The kernel must be of shape (Cout, Cin, Lk)
- Cout is the number of output channels
- Cin is the number of input channels
- Lk is the length of the kernel
The resulting output shape will be (N, Cout, Lout)
Trait Implementations
Registers the weight and the bias of this Conv1d
instance.
Register self
’s status to the model’s status state status
.