Class FtTrainingConfig

java.lang.Object
ai.djl.fasttext.FtTrainingConfig
All Implemented Interfaces:
ai.djl.training.TrainingConfig

public class FtTrainingConfig extends Object implements ai.djl.training.TrainingConfig
An interface that is responsible for holding the configuration required by fastText training.
  • Method Details

    • getTrainingMode

      public FtTrainingMode getTrainingMode()
      Returns the @{link FtTrainingMode}.
      Returns:
      the @{code FtTrainingMode}
    • getOutputDir

      public Path getOutputDir()
      Returns the output directory.
      Returns:
      the output directory
    • getModelName

      public String getModelName()
      Return the name of the model.
      Returns:
      the name of the model
    • getEpoch

      public int getEpoch()
      Returns number of epochs.
      Returns:
      number of epochs
    • getMinWordCount

      public int getMinWordCount()
      Return minimal number of word occurrences.
      Returns:
      minimal number of word occurrences
    • getMinLabelCount

      public int getMinLabelCount()
      Returns minimal number of label occurrences.
      Returns:
      minimal number of label occurrences
    • getMaxNgramLength

      public int getMaxNgramLength()
      Returns maximum length of word ngram.
      Returns:
      maximum length of word ngram
    • getMinCharLength

      public int getMinCharLength()
      Return minimum length of char ngram.
      Returns:
      minimum length of char ngram
    • getMaxCharLength

      public int getMaxCharLength()
      Return maximum length of char ngram.
      Returns:
      maximum length of char ngram
    • getBucket

      public int getBucket()
      Returns number of buckets.
      Returns:
      number of buckets
    • getSamplingThreshold

      public float getSamplingThreshold()
      Returns sampling threshold.
      Returns:
      sampling threshold
    • getLabelPrefix

      public String getLabelPrefix()
      Return label prefix.
      Returns:
      label prefix
    • getLearningRate

      public float getLearningRate()
      Returns learning rate.
      Returns:
      learning rate
    • getLearningRateUpdateRate

      public int getLearningRateUpdateRate()
      Returns the rate of updates for the learning rate.
      Returns:
      the rate of updates for the learning rate
    • getWordVecSize

      public int getWordVecSize()
      Returns size of word vectors.
      Returns:
      size of word vectors
    • getContextWindow

      public int getContextWindow()
      Returns size of the context window.
      Returns:
      size of the context window
    • getNumNegativesSampled

      public int getNumNegativesSampled()
      Returns number of negatives sampled.
      Returns:
      number of negatives sampled
    • getThreads

      public int getThreads()
      Returns number training threads.
      Returns:
      number training threads
    • getLoss

      public String getLoss()
      Returns the loss function.
      Returns:
      the loss function
    • getDevices

      public ai.djl.Device[] getDevices()
      Specified by:
      getDevices in interface ai.djl.training.TrainingConfig
    • getInitializers

      public ai.djl.util.PairList<ai.djl.training.initializer.Initializer,Predicate<ai.djl.nn.Parameter>> getInitializers()
      Specified by:
      getInitializers in interface ai.djl.training.TrainingConfig
    • getOptimizer

      public ai.djl.training.optimizer.Optimizer getOptimizer()
      Specified by:
      getOptimizer in interface ai.djl.training.TrainingConfig
    • getLossFunction

      public ai.djl.training.loss.Loss getLossFunction()
      Specified by:
      getLossFunction in interface ai.djl.training.TrainingConfig
    • getExecutorService

      public ExecutorService getExecutorService()
      Specified by:
      getExecutorService in interface ai.djl.training.TrainingConfig
    • getEvaluators

      public List<ai.djl.training.evaluator.Evaluator> getEvaluators()
      Specified by:
      getEvaluators in interface ai.djl.training.TrainingConfig
    • getTrainingListeners

      public List<ai.djl.training.listener.TrainingListener> getTrainingListeners()
      Specified by:
      getTrainingListeners in interface ai.djl.training.TrainingConfig
    • toCommand

      public String[] toCommand(String input)
      Returns the fastText command in an array.
      Parameters:
      input - training dataset file path
      Returns:
      the fastText command in an array
    • builder

      public static FtTrainingConfig.Builder builder()
      Creates a builder to build a FtTrainingConfig.
      Returns:
      a new builder