Interface Trainable

    • Method Detail

      • getConfig

        TrainingConfig getConfig()
        Returns:
        Training configuration
      • numParams

        long numParams()
        Returns:
        Number of parameters
      • params

        INDArray params()
        Returns:
        1d parameter vector
      • paramTable

        Map<String,​INDArray> paramTable​(boolean backpropOnly)
        Parameters:
        backpropOnly - If true: return only parameters that are not exclusively used for layerwise pretraining
        Returns:
        Parameter table
      • updaterDivideByMinibatch

        boolean updaterDivideByMinibatch​(String paramName)
        DL4J layers typically produce the sum of the gradients during the backward pass for each layer, and if required (if minibatch=true) then divide by the minibatch size.
        However, there are some exceptions, such as the batch norm mean/variance estimate parameters: these "gradients" are actually not gradients, but are updates to be applied directly to the parameter vector. Put another way, most gradients should be divided by the minibatch to get the average; some "gradients" are actually final updates already, and should not be divided by the minibatch size.
        Parameters:
        paramName - Name of the parameter
        Returns:
        True if gradients should be divided by minibatch (most params); false otherwise (edge cases like batch norm mean/variance estimates)
      • getGradientsViewArray

        INDArray getGradientsViewArray()
        Returns:
        1D gradients view array