• Layer that multiplies (element-wise) an Array of inputs.

    It takes as input an Array of tensors, all of the same shape, and returns a single tensor (also of the same shape). For example:

    const input1 = tf.input({shape: [2, 2]});
    const input2 = tf.input({shape: [2, 2]});
    const input3 = tf.input({shape: [2, 2]});
    const multiplyLayer = tf.layers.multiply();
    const product = multiplyLayer.apply([input1, input2, input3]);
    console.log(product.shape);
    // You get [null, 2, 2], with the first dimension as the undetermined batch
    // dimension.

    @doc {heading: 'Layers', subheading: 'Merge', namespace: 'layers'}

    Parameters

    • Optional args: LayerArgs

    Returns Multiply

Generated using TypeDoc