• Computes the dot product of two matrices with optional activation and bias.

    const a = tf.tensor2d([-1, -2], [1, 2]);
    const b = tf.tensor2d([1, 2, 3, 4], [2, 2]);
    const bias = tf.tensor2d([1, 2], [1, 2]);

    tf.fused.matMul({a, b, bias, activation: 'relu'}).print();

    Parameters

    • obj: {
          a: Tensor<Rank> | TensorLike;
          activation?: Activation;
          b: Tensor<Rank> | TensorLike;
          bias?: Tensor<Rank> | TensorLike;
          leakyreluAlpha?: number;
          preluActivationWeights?: Tensor<Rank>;
          transposeA?: boolean;
          transposeB?: boolean;
      }

      An object with the following properties:

      • a First matrix in dot product operation.
      • b Second matrix in dot product operation.
      • transposeA If true, a is transposed before multiplication.
      • transposeB If true, b is transposed before multiplication.
      • bias Matrix to be added to the result.
      • activation Name of activation kernel (defaults to linear).
      • preluActivationWeights Tensor of prelu weights.
      • leakyreluAlpha Alpha of leakyrelu.

    Returns Tensor

Generated using TypeDoc