• Computes dropout.

    const x = tf.tensor1d([1, 2, 2, 1]);
    const rate = 0.75;
    const output = tf.dropout(x, rate);
    output.print();

    Parameters

    • x: Tensor<Rank> | TensorLike

      A floating point Tensor or TensorLike.

    • rate: number

      A float in the range [0, 1). The probability that each element of x is discarded.

    • Optional noiseShape: number[]

      An array of numbers of type int32, representing the shape for randomly generated keep/drop flags. If the noiseShape has null value, it will be automatically replaced with the x's relative dimension size. Optional.

    • Optional seed: string | number

      Used to create random seeds. Optional.

    Returns Tensor

    A Tensor of the same shape of x.

    Doc

Generated using TypeDoc