[Biojava-l] Parameter Settings in BaumWelchTraining
mark.schreiber at group.novartis.com
mark.schreiber at group.novartis.com
Thu Mar 11 20:58:52 EST 2004
Hi Stephane -
Within EmissionState you can set a Distribution that contains emission
probabilities for the Symbols states emission alphabet using the
setDistribution method. This Distribution will be your predetermined
weights.
To set the transition probabilities you can use the setWeights(State
source, Distribution weights). The source is the state you are
transitioning from and the weights is the probability of transitioning to
any State that the source connects too. Because States implement Symbol
you can put them in a Distribution.
To make a Distribution of States that state 'a' could connect to use the
following pseudo code:
State a;
Model m;
FiniteAlphabet endPoints;
endPoints = m.transitionsFrom(a);
Distribution d =
DistributionFactory.DEFAULT.createDistribution(endPoints);
//You can then train d or set it's weights and put it back in the model
with
m.setWeights(a, d);
Mark Schreiber
Principal Scientist (Bioinformatics)
Novartis Institute for Tropical Diseases (NITD)
1 Science Park Road
#04-14 The Capricorn, Science Park II
Singapore 117528
phone +65 6722 2973
fax +65 6722 2910
sacoca at mcb.mcgill.ca
Sent by: biojava-l-bounces at portal.open-bio.org
03/12/2004 06:11 AM
To: "Biojava Mailing List" <biojava-l at biojava.org>
cc:
Subject: [Biojava-l] Parameter Settings in BaumWelchTraining
Hi all. I'm trying to optimize the transition states probabilities for my
HMM. I already have set them to values which I think are pretty good.
Since I know the Baum Welch can only help with the scores and optimize
them up to a local maxima I thought of using the parameters I calculated
as a starting point. The problem is that I don't know how!
I followed the example in biojava:
....
//train the model to have uniform parameters
ModelTrainer mt = new SimpleModelTrainer();
//register the model to train
mt.registerModel(hmm);
I want to use the values already set in my hmm as the starting parameters
in the BaumWelch. I don't want to use the uniform distribution as
indicated below!
//as no other counts are being used the null weight will cause
everything to be uniform
mt.setNullModelWeight(1.0);
mt.train();
I tried adding counts and looking up examples on the net but ended up more
confused than I started. How do I use the addCounts to make this work!
Stephane Acoca
Master's Student
McGill Center for Bioinformatics
_______________________________________________
Biojava-l mailing list - Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l
More information about the Biojava-l
mailing list