Interface DropoutHelper

    • Method Detail

      • checkSupported

        boolean checkSupported()
        Specified by:
        checkSupported in interface LayerHelper
        Returns:
        Check if this dropout helper is supported in the current environment
      • applyDropout

        void applyDropout​(INDArray inputActivations,
                          INDArray resultArray,
                          double dropoutInputRetainProb)
        Apply the dropout during forward pass
        Parameters:
        inputActivations - Input activations (pre dropout)
        resultArray - Output activations (post dropout). May be same as (or different to) input array
        dropoutInputRetainProb - Probability of retaining an activation
      • backprop

        void backprop​(INDArray gradAtOutput,
                      INDArray gradAtInput)
        Perform backpropagation. Note that the same dropout mask should be used for backprop as was used during the last call to applyDropout(INDArray, INDArray, double)
        Parameters:
        gradAtOutput - Gradient at output (from perspective of forward pass)
        gradAtInput - Result array - gradient at input. May be same as (or different to) gradient at input