Class IndependentSequenceTrainer<T extends Output<T>>

java.lang.Object
org.tribuo.sequence.IndependentSequenceTrainer<T>
Type Parameters:
T - The output type.
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<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.
      Parameters:
      innerTrainer - The trainer to use.
  • Method Details

    • train

      public IndependentSequenceModel<T> train(SequenceDataset<T> sequenceExamples, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> 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>>
      Parameters:
      sequenceExamples - the data set containing the examples.
      runProvenance - Training run specific provenance (e.g., fold number).
      Returns:
      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>>
      Returns:
      The number of times train has been invoked.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProvenance

      public TrainerProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<T extends Output<T>>