Package ai.djl.fasttext
Class FtTrainingConfig
java.lang.Object
ai.djl.fasttext.FtTrainingConfig
- All Implemented Interfaces:
ai.djl.training.TrainingConfig
An interface that is responsible for holding the configuration required by fastText training.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder to construct aFtTrainingConfig.static enumLoss functions that fastText supports. -
Method Summary
Modifier and TypeMethodDescriptionstatic FtTrainingConfig.Builderbuilder()Creates a builder to build aFtTrainingConfig.intReturns number of buckets.intReturns size of the context window.ai.djl.Device[]intgetEpoch()Returns number of epochs.List<ai.djl.training.evaluator.Evaluator>ai.djl.util.PairList<ai.djl.training.initializer.Initializer,Predicate<ai.djl.nn.Parameter>> Return label prefix.floatReturns learning rate.intReturns the rate of updates for the learning rate.getLoss()Returns the loss function.ai.djl.training.loss.LossintReturn maximum length of char ngram.intReturns maximum length of word ngram.intReturn minimum length of char ngram.intReturns minimal number of label occurrences.intReturn minimal number of word occurrences.Return the name of the model.intReturns number of negatives sampled.ai.djl.training.optimizer.OptimizerReturns the output directory.floatReturns sampling threshold.intReturns number training threads.List<ai.djl.training.listener.TrainingListener>Returns the @{link FtTrainingMode}.intReturns size of word vectors.String[]Returns the fastText command in an array.
-
Method Details
-
getTrainingMode
Returns the @{link FtTrainingMode}.- Returns:
- the @{code FtTrainingMode}
-
getOutputDir
Returns the output directory.- Returns:
- the output directory
-
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
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
Returns the loss function.- Returns:
- the loss function
-
getDevices
public ai.djl.Device[] getDevices()- Specified by:
getDevicesin interfaceai.djl.training.TrainingConfig
-
getInitializers
public ai.djl.util.PairList<ai.djl.training.initializer.Initializer,Predicate<ai.djl.nn.Parameter>> getInitializers()- Specified by:
getInitializersin interfaceai.djl.training.TrainingConfig
-
getOptimizer
public ai.djl.training.optimizer.Optimizer getOptimizer()- Specified by:
getOptimizerin interfaceai.djl.training.TrainingConfig
-
getLossFunction
public ai.djl.training.loss.Loss getLossFunction()- Specified by:
getLossFunctionin interfaceai.djl.training.TrainingConfig
-
getExecutorService
- Specified by:
getExecutorServicein interfaceai.djl.training.TrainingConfig
-
getEvaluators
- Specified by:
getEvaluatorsin interfaceai.djl.training.TrainingConfig
-
getTrainingListeners
- Specified by:
getTrainingListenersin interfaceai.djl.training.TrainingConfig
-
toCommand
Returns the fastText command in an array.- Parameters:
input- training dataset file path- Returns:
- the fastText command in an array
-
builder
Creates a builder to build aFtTrainingConfig.- Returns:
- a new builder
-