Package org.biojava.bio.dp
Class AbstractTrainer
- java.lang.Object
-
- org.biojava.bio.dp.AbstractTrainer
-
- All Implemented Interfaces:
TrainingAlgorithm
- Direct Known Subclasses:
BaumWelchSampler,BaumWelchTrainer
public abstract class AbstractTrainer extends Object implements TrainingAlgorithm
An abstract implementation of TrainingAlgorithm that provides a framework for plugging in per-cycle code for parameter optimization.- Author:
- Matthew Pocock, Thomas Down
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTrainer()AbstractTrainer(DP dp)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description doublegetCurrentScore()intgetCycle()DPgetDP()doublegetLastScore()protected abstract doublesingleSequenceIteration(ModelTrainer trainer, SymbolList symList)voidtrain(SequenceDB db, double nullModelWeight, StoppingCriteria stopper)Trains the sequences in db until stopper says to finnish.
-
-
-
Constructor Detail
-
AbstractTrainer
public AbstractTrainer(DP dp)
-
AbstractTrainer
protected AbstractTrainer()
-
-
Method Detail
-
getLastScore
public double getLastScore()
- Specified by:
getLastScorein interfaceTrainingAlgorithm
-
getCurrentScore
public double getCurrentScore()
- Specified by:
getCurrentScorein interfaceTrainingAlgorithm
-
getCycle
public int getCycle()
- Specified by:
getCyclein interfaceTrainingAlgorithm
-
getDP
public DP getDP()
- Specified by:
getDPin interfaceTrainingAlgorithm
-
singleSequenceIteration
protected abstract double singleSequenceIteration(ModelTrainer trainer, SymbolList symList) throws IllegalSymbolException, IllegalTransitionException, IllegalAlphabetException
-
train
public void train(SequenceDB db, double nullModelWeight, StoppingCriteria stopper) throws IllegalSymbolException, BioException
Trains the sequences in db until stopper says to finnish.- Specified by:
trainin interfaceTrainingAlgorithm- Throws:
IllegalSymbolExceptionBioException
-
-