Class SpatialDropout

    • Constructor Detail

      • SpatialDropout

        public SpatialDropout​(double activationRetainProbability)
        Parameters:
        activationRetainProbability - Probability of retaining an activation - see Dropout javadoc
      • SpatialDropout

        public SpatialDropout​(ISchedule activationRetainProbabilitySchedule)
        Parameters:
        activationRetainProbabilitySchedule - Schedule for probability of retaining an activation - see Dropout javadoc
      • SpatialDropout

        protected SpatialDropout​(double activationRetainProbability,
                                 ISchedule activationRetainProbabilitySchedule)
    • Method Detail

      • applyDropout

        public INDArray applyDropout​(INDArray inputActivations,
                                     INDArray output,
                                     int iteration,
                                     int epoch,
                                     LayerWorkspaceMgr workspaceMgr)
        Specified by:
        applyDropout in interface IDropout
        Parameters:
        inputActivations - Input activations array
        output - The result array (same as inputArray for in-place ops) for the post-dropout activations
        iteration - Current iteration number
        epoch - Current epoch number
        workspaceMgr - Workspace manager, if any storage is required (use ArrayType.INPUT)
        Returns:
        The output (resultArray) after applying dropout
      • backprop

        public INDArray backprop​(INDArray gradAtOutput,
                                 INDArray gradAtInput,
                                 int iteration,
                                 int epoch)
        Description copied from interface: IDropout
        Perform backprop. This should also clear the internal state (dropout mask) if any is present
        Specified by:
        backprop in interface IDropout
        Parameters:
        gradAtOutput - Gradients at the output of the dropout op - i.e., dL/dOut
        gradAtInput - Gradients at the input of the dropout op - i.e., dL/dIn. Use the same array as gradAtOutput to apply the backprop gradient in-place
        iteration - Current iteration
        epoch - Current epoch
        Returns:
        Same array as gradAtInput - i.e., gradient after backpropagating through dropout op - i.e., dL/dIn
      • clear

        public void clear()
        Description copied from interface: IDropout
        Clear the internal state (for example, dropout mask) if any is present
        Specified by:
        clear in interface IDropout