Interface Gradient

    • Method Detail

      • gradientForVariable

        Map<String,​INDArray> gradientForVariable()
        Gradient look up table
        Returns:
        the gradient look up table
      • gradient

        INDArray gradient​(List<String> order)
        The full gradient as one flat vector
        Returns:
      • gradient

        INDArray gradient()
        The full gradient as one flat vector
        Returns:
      • clear

        void clear()
        Clear residual parameters (useful for returning a gradient and then clearing old objects)
      • getGradientFor

        INDArray getGradientFor​(String variable)
        The gradient for the given variable
        Parameters:
        variable - the variable to get the gradient for
        Returns:
        the gradient for the given variable or null
      • setGradientFor

        INDArray setGradientFor​(String variable,
                                INDArray gradient)
        Update gradient for the given variable
        Parameters:
        variable - the variable to get the gradient for
        gradient - the gradient values
        Returns:
        the gradient for the given variable or null
      • setGradientFor

        INDArray setGradientFor​(String variable,
                                INDArray gradient,
                                Character flatteningOrder)
        Update gradient for the given variable; also (optionally) specify the order in which the array should be flattened to a row vector
        Parameters:
        variable - the variable to get the gradient for
        gradient - the gradient values
        flatteningOrder - the order in which gradients should be flattened (null ok - default)
        Returns:
        the gradient for the given variable or null
      • flatteningOrderForVariable

        Character flatteningOrderForVariable​(String variable)
        Return the gradient flattening order for the specified variable, or null if it is not explicitly set
        Parameters:
        variable - Variable to return the gradient flattening order for
        Returns:
        Order in which the specified variable's gradient should be flattened