Dropout

@frozen
public struct Dropout<Scalar> : ParameterlessLayer where Scalar : TensorFlowFloatingPoint

A dropout layer.

Dropout consists in randomly setting a fraction of input units to 0 at each update during training time, which helps prevent overfitting.

  • Declaration

    public typealias TangentVector = EmptyTangentVector
  • Declaration

    @noDerivative
    public let probability: Double
  • Creates a dropout layer.

    Precondition

    probability must be a value between 0 and 1 (inclusive).

    Declaration

    public init(probability: Double)

    Parameters

    probability

    The probability of a node dropping out.

  • Returns the output obtained from applying the layer to the given input.

    Declaration

    @differentiable
    public func forward(_ input: Tensor<Scalar>) -> Tensor<Scalar>

    Parameters

    input

    The input to the layer.

    Return Value

    The output.