java.lang.Object
com.jml.neural_network.layers.initilizers.Constant
All Implemented Interfaces:
Initializer

public class Constant extends Object implements Initializer
layer parameter initializer to produce a constant value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a Constant Initializer with value 1.
    Constant​(double value)
    Creates a Constant Initializer with specified value.
  • Method Summary

    Modifier and Type
    Method
    Description
    linalg.Matrix
    init​(int m, int n)
    Initializes values of a weight/bias matrix as specified by this initializer.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Constant

      public Constant()
      Creates a Constant Initializer with value 1. This is equivalent to the Ones Initializer.
    • Constant

      public Constant(double value)
      Creates a Constant Initializer with specified value.
      Parameters:
      value - Constant to fill matrix with.
  • Method Details

    • init

      public linalg.Matrix init(int m, int n)
      Initializes values of a weight/bias matrix as specified by this initializer.
      Specified by:
      init in interface Initializer
      Parameters:
      m - Number of rows in the matrix.
      n - Number of columns in the matrix.
      Returns:
      A Matrix initialized with values from the distribution specified by this initializer.