Package org.biojava.bio.dp
Class AbstractTrainer
java.lang.Object
org.biojava.bio.dp.AbstractTrainer
- All Implemented Interfaces:
TrainingAlgorithm
- Direct Known Subclasses:
BaumWelchSampler
,BaumWelchTrainer
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 -
Method Summary
Modifier and TypeMethodDescriptiondouble
int
getCycle()
getDP()
double
protected abstract double
singleSequenceIteration
(ModelTrainer trainer, SymbolList symList) void
train
(SequenceDB db, double nullModelWeight, StoppingCriteria stopper) Trains the sequences in db until stopper says to finnish.
-
Constructor Details
-
AbstractTrainer
-
AbstractTrainer
protected AbstractTrainer()
-
-
Method Details
-
getLastScore
- Specified by:
getLastScore
in interfaceTrainingAlgorithm
-
getCurrentScore
- Specified by:
getCurrentScore
in interfaceTrainingAlgorithm
-
getCycle
- Specified by:
getCycle
in interfaceTrainingAlgorithm
-
getDP
- Specified by:
getDP
in 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:
train
in interfaceTrainingAlgorithm
- Throws:
IllegalSymbolException
BioException
-