Class IndependentSequenceTrainer<T extends Output<T>>

Type Parameters:
T - The output type.
All Implemented Interfaces:,<TrainerProvenance>, SequenceTrainer<T>

public class IndependentSequenceTrainer<T extends Output<T>> extends Object implements SequenceTrainer<T>
Trains a sequence model by training a regular model to independently predict every example in each sequence.
  • Constructor Details

    • IndependentSequenceTrainer

      public IndependentSequenceTrainer(Trainer<T> innerTrainer)
      Builds a sequence trainer which uses a Trainer to independently predict each sequence element.
      innerTrainer - The trainer to use.
  • Method Details

    • train

      public IndependentSequenceModel<T> train(SequenceDataset<T> sequenceExamples, Map<String,> runProvenance)
      Description copied from interface: SequenceTrainer
      Trains a sequence prediction model using the examples in the given data set.
      Specified by:
      train in interface SequenceTrainer<T extends Output<T>>
      sequenceExamples - the data set containing the examples.
      runProvenance - Training run specific provenance (e.g., fold number).
      a predictive model that can be used to generate predictions for new examples.
    • getInvocationCount

      public int getInvocationCount()
      Description copied from interface: SequenceTrainer
      Returns the number of times the train method has been invoked.
      Specified by:
      getInvocationCount in interface SequenceTrainer<T extends Output<T>>
      The number of times train has been invoked.
    • toString

      public String toString()
      toString in class Object
    • getProvenance

      public TrainerProvenance getProvenance()
      Specified by:
      getProvenance in interface<T extends Output<T>>