• Computes a 2D convolution over the input x, optionally fused with adding a bias and applying an activation.

    const inputDepth = 2;
    const inShape = [2, 2, 2, inputDepth];
    const outputDepth = 2;
    const fSize = 1;
    const pad = 0;
    const strides = 1;

    const x = tf.tensor4d( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
    16], inShape);
    const w = tf.tensor4d([-1, 1, -2, 0.5], [fSize, fSize, inputDepth,
    outputDepth]);

    tf.fused.conv2d({ x, filter: w, strides, pad, dataFormat: 'NHWC',
    dilations: [1, 1], bias: tf.scalar(5), activation: 'relu' }).print();

    Type Parameters

    Parameters

    • __namedParameters: {
          activation?: Activation;
          bias?: Tensor<Rank> | TensorLike;
          dataFormat?: "NHWC" | "NCHW";
          dilations?: number | [number, number];
          dimRoundingMode?: "floor" | "round" | "ceil";
          filter: TensorLike | Tensor4D;
          leakyreluAlpha?: number;
          pad: number | "same" | "valid" | ExplicitPadding;
          preluActivationWeights?: Tensor<Rank>;
          strides: number | [number, number];
          x: TensorLike | T;
      }
      • Optional activation?: Activation
      • Optional bias?: Tensor<Rank> | TensorLike
      • Optional dataFormat?: "NHWC" | "NCHW"
      • Optional dilations?: number | [number, number]
      • Optional dimRoundingMode?: "floor" | "round" | "ceil"
      • filter: TensorLike | Tensor4D
      • Optional leakyreluAlpha?: number
      • pad: number | "same" | "valid" | ExplicitPadding
      • Optional preluActivationWeights?: Tensor<Rank>
      • strides: number | [number, number]
      • x: TensorLike | T

    Returns T

Generated using TypeDoc