Interface TrainableLayer

All Superinterfaces:
BaseLayer
All Known Implementing Classes:
Dense, Linear

public interface TrainableLayer extends BaseLayer
This layer specifies functionality for a layer that has trainable parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    linalg.Matrix[]
    Gets the trainable parameters for this layer as an array of matrices.
    linalg.Matrix[]
    Gets the update matrices for parameters of this layer.
    void
    Resists the accumulation of gradients for this layer.
    void
    setParams​(linalg.Matrix... params)
    Sets the parameters for this layer.

    Methods inherited from interface com.jml.neural_network.layers.BaseLayer

    back, forward, getDetails, getInDim, getOutDim, inspect, updateInDim
  • Method Details

    • getParams

      linalg.Matrix[] getParams()
      Gets the trainable parameters for this layer as an array of matrices.
      Specified by:
      getParams in interface BaseLayer
      Returns:
      The trainable parameters for this layer as an array of matrices.
    • setParams

      void setParams(linalg.Matrix... params)
      Sets the parameters for this layer.
      Specified by:
      setParams in interface BaseLayer
      Parameters:
      params - Parameter matrices for this layer.
    • resetGradients

      void resetGradients()
      Resists the accumulation of gradients for this layer.
      Specified by:
      resetGradients in interface BaseLayer
    • getUpdates

      linalg.Matrix[] getUpdates()
      Gets the update matrices for parameters of this layer.
      Specified by:
      getUpdates in interface BaseLayer
      Returns:
      The parameter update matrices.