Function conv2d

  • Applies a 2D convolution over an input image composed of several input planes.

    Forward

    output[y, x] = sum(Ky, sum(Kx, input[y + ky, x + kx] * weight[ky, kx])) + bias
    

    Parameters

    • input: Tensor

      input tensor of shape [B, inChannels, iH, iW]

    • weight: Tensor

      filters of shape [outChannels, inChannels, kH, kW]

    • Optional bias: Tensor

      optional bias tensor of shape [outChannels]

    • Optional stride: number | [number, number]

      the stride of the convolving kernel. Can be a single number or a tuple (sH, sW). Default: 1

    • Optional padding: number | [number, number] | "valid" | "same"

      implicit padding on both sides of the kernel. Can be a single number or a tuple (padH, padW). Default: 0 padding="valid" is the same as no padding. padding="same" pads the input so the output has the shape as the input. However, this mode can only be used when stride is 1.

    Returns Tensor

Generated using TypeDoc