logo

Struct neuronika::nn::GroupedConv3d[][src]

pub struct GroupedConv3d<Pad: PaddingMode> {
    pub padding: (usize, usize, usize),
    pub padding_mode: Pad,
    pub stride: (usize, usize, usize),
    pub dilation: (usize, usize, usize),
    pub groups: usize,
    pub weight: Learnable<Ix5>,
    pub bias: Learnable<Ix1>,
}
Expand description

Applies a grouped volumetric convolution over an input signal composed of several input planes.

Fields

padding: (usize, usize, usize)padding_mode: Padstride: (usize, usize, usize)dilation: (usize, usize, usize)groups: usizeweight: Learnable<Ix5>bias: Learnable<Ix1>

Implementations

Creates a new GroupedConv3d.

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 3-tuple for this three-dimensional case.

  • padding - padding to be applied to the input, a 3-tuple for this three-dimensional case.

  • padding_mode - padding mode, it can be: Zero, Constant, Reflective or Replicative.

  • stride - stride of the convolution, a 3-tuple for this three-dimensional case.

  • dilation - controls the spacing between the kernel points, a 3-tuple for this three-dimensional case.

  • groups - controls the connections between inputs and outputs. in_channels and out_channels must both be divisible by groups.

For example:

  • at groups = 1, all inputs are convolved to all outputs.
  • at groups = 2, the operation becomes equivalent to having two convolutional layers side by side, each seeing half the input channels and producing half the output channels, and both subsequently concatenated.
  • at groups = in_channels, each input channel is convolved with its own set of filters.

The weight and the bias are initialized from U(-k, k) where k = (groups /(in_channels * kernel_d * kernel_h * kernel_w) as f32).sqrt().

Computes a 3-dimensional grouped convolution (cross correlation).

input - the signal to convolve.

The input must be of shape (N, Cin, D, H, W)

  • N is the batch size
  • Cin is the number of input channels
  • D is the depth of the input
  • H is the height of the input
  • W is the width of the input

The kernel must be of shape (Cout, Cin, Dk, Hk, Wk)

  • Cout is the number of output channels
  • Cin is the number of input channels
  • Dk is the depth of the kernel
  • Hk is the height of the kernel
  • Wk is the width of the kernel

The resulting output shape will be (N, Cout, Dout, Hout, Wout)

Trait Implementations

Registers the weight and the bias of this GroupedConv3d 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.