[Biojava-l] Training MarkovModel - Which files/classes to change???

Thomas Down thomas at derkholm.net
Thu May 8 10:46:09 EDT 2003


Once upon a time, on a computer far far away, Oscar Lopes wrote:
> Hello,
> 
> I need to change some of the training algoritms in order to train only 
> state transitions. I have defined a model with "fixed" emission 
> distributions and I only need to adjust the transitions weigths.
> Can anyone give me a hint about were to start changing some of the 
> existing files????

The training code uses DistributionTrainer objects to accumulate
counts and re-set the weights of Distributions.  For those
Distributions which you want to keep fixed, you need to use
a registerWithTrainer method which uses a non-functional
DistributionTrainer.  The following should work:

    public class UntrainableDistribution extends SimpleDistribution {
        public UntrainableDistribution(FiniteAlphabet alpha) {
            super(alpha);
        }
    
        public void registerWithTrainer(DistributionTrainerContext dtc) {
            dtc.registerTrainer(this, IgnoreCountsTrainer.getInstance());
        }
    }

(This is simple and generally useful enough that it should
probably be included in biojava -- I'll add it later today).

Hope this helps,

     Thomas.



More information about the Biojava-l mailing list