logo

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: usizepadding_mode: Padstride: usizedilation: usizeweight: 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 or Replicative.

  • 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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.