Record Class FeedforwardDependencyTrainer.Settings

java.lang.Object
java.lang.Record
opennlp.tools.depparse.FeedforwardDependencyTrainer.Settings
Record Components:
embeddingSize - The embedding dimensionality. Must be positive.
hiddenSize - The hidden layer width. Must be positive.
epochs - The number of passes over the examples. Must be positive.
batchSize - The minibatch size. Must be positive.
learningRate - The AdaGrad step size. Must be positive.
l2 - The L2 penalty applied to the dense weights. Must not be negative.
dropout - The hidden dropout probability. Must be in [0, 1).
wordCutoff - The minimum frequency for a word to get its own embedding. Must not be negative.
seed - The random seed making a run reproducible.
beamSize - The refinement beam width; FeedforwardDependencyTrainer.refine(opennlp.tools.depparse.FeedforwardDependencyModel, opennlp.tools.util.ObjectStream<opennlp.tools.depparse.DependencySample>, opennlp.tools.util.TrainingParameters) requires at least 2.
Enclosing class:
FeedforwardDependencyTrainer

static record FeedforwardDependencyTrainer.Settings(int embeddingSize, int hiddenSize, int epochs, int batchSize, double learningRate, double l2, double dropout, int wordCutoff, long seed, int beamSize) extends Record
The parsed hyperparameters of one training or refinement run.
  • Field Details

    • embeddingSize

      private final int embeddingSize
      The field for the embeddingSize record component.
    • hiddenSize

      private final int hiddenSize
      The field for the hiddenSize record component.
    • epochs

      private final int epochs
      The field for the epochs record component.
    • batchSize

      private final int batchSize
      The field for the batchSize record component.
    • learningRate

      private final double learningRate
      The field for the learningRate record component.
    • l2

      private final double l2
      The field for the l2 record component.
    • dropout

      private final double dropout
      The field for the dropout record component.
    • wordCutoff

      private final int wordCutoff
      The field for the wordCutoff record component.
    • seed

      private final long seed
      The field for the seed record component.
    • beamSize

      private final int beamSize
      The field for the beamSize record component.
  • Constructor Details

    • Settings

      Settings(int embeddingSize, int hiddenSize, int epochs, int batchSize, double learningRate, double l2, double dropout, int wordCutoff, long seed, int beamSize)
      Validates the hyperparameters.
      Throws:
      IllegalArgumentException - Thrown if a value is outside its documented range or the smallest network of this shape exceeds ResourceLimits.MAX_MATRIX_CELLS float values.
  • Method Details

    • from

      Reads the hyperparameters, substituting the defaults for absent keys.
      Parameters:
      parameters - The training parameters. Must not be null.
      Returns:
      The parsed settings. Never null.
      Throws:
      IllegalArgumentException - Thrown if a value is outside its documented range.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • embeddingSize

      public int embeddingSize()
      Returns the value of the embeddingSize record component.
      Returns:
      the value of the embeddingSize record component
    • hiddenSize

      public int hiddenSize()
      Returns the value of the hiddenSize record component.
      Returns:
      the value of the hiddenSize record component
    • epochs

      public int epochs()
      Returns the value of the epochs record component.
      Returns:
      the value of the epochs record component
    • batchSize

      public int batchSize()
      Returns the value of the batchSize record component.
      Returns:
      the value of the batchSize record component
    • learningRate

      public double learningRate()
      Returns the value of the learningRate record component.
      Returns:
      the value of the learningRate record component
    • l2

      public double l2()
      Returns the value of the l2 record component.
      Returns:
      the value of the l2 record component
    • dropout

      public double dropout()
      Returns the value of the dropout record component.
      Returns:
      the value of the dropout record component
    • wordCutoff

      public int wordCutoff()
      Returns the value of the wordCutoff record component.
      Returns:
      the value of the wordCutoff record component
    • seed

      public long seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component
    • beamSize

      public int beamSize()
      Returns the value of the beamSize record component.
      Returns:
      the value of the beamSize record component