Saturday, April 26, 2008
dirichlet process mixture models
A little while ago I released a package for dirichlet process mixture models in matlab. I'd like to use the blog to handle questions, as I did with the annealed particle filter. First of all, I'm able to get it to run by saying:
Or, for BNT 1.0.4
Please try this before emailing :)
Also, I was asked about the meaning of the variables:
On Wed, Jan 23, 2008 at 3:33 AM, Tian,Guangjian wrote:
"Would you please give me some reference for standard gaussian dirichlet process
mixture models?"
Jacob: I can recommend Rasmussen's "Infinite Gaussian Mixture Model" from NIPS 2000, Teh et al "Hierarchical Dirichlet Processes", and Erik Sudderth's PhD thesis, chapter 2.
Guangjian: "I find your matlab code for DP mixture models, I want to test the cluster
property of DP mixture models. But, when I use the code, I got some
errors(your example is ok), I want to fix the problem. But I don't know some
variables meanings in your program. Just like the following params."
params(1).alpha = T / 50; %1 / wishrnd(1,1);
J: concentration parameter -- see any tutorial on DPMMs, e.g. Rasmussen
params(1).kappa = .1; %T / 1000; %a pseudo count on the mean
J: Essentially, how much to trust the prior on the mean.
params(1).nu = 6; %a pseudo-count on the covariance
J: how much to trust the prior on the covariance
params(1).initmean = allmean;
J: prior on the mean of each cluster
params(1).initcov = allcov / 10;
J: prior on the covariance of each cluster
params(1).num_classes = 0;
J: system variable to keep track of the number of clusters generated
params(1).counts = 0;
params(1).sums = [];
params(1).cholSSE = [];
J: these are sufficient statistics for the cluster centers that can be incrementally updated. the mean of a cluster equals its sum divided by its count. The cholSSE variable is the cholesky decomposition of the covariance matrix.
params(1).classes = ones(T,1);
J: assignment of instances to clusters
% params(1).SSE = [];
params(1) = addNewClass(params(1));
J: initializes the first cluster.
params(1) = unhideObservations(params(1), 1, data);
J: assigns all observations to the first cluster
----
Good luck, and please post questions to the blog.
--Jacob
addpath('~/drg/lib/FullBNT-1.0.2/BNT/')
add_BNT_to_path
addpath(' ~/drg/lib/lightspeed/')
demodpmm
Or, for BNT 1.0.4
addpath('~/drg/lib/FullBNT-1.0.4');
addpath(genpathKPM('~/drg/lib/FullBNT-1.0.4'));
addpath('~/drg/lib/lightspeed/');
demodpmm
Please try this before emailing :)
Also, I was asked about the meaning of the variables:
On Wed, Jan 23, 2008 at 3:33 AM, Tian,Guangjian wrote:
"Would you please give me some reference for standard gaussian dirichlet process
mixture models?"
Jacob: I can recommend Rasmussen's "Infinite Gaussian Mixture Model" from NIPS 2000, Teh et al "Hierarchical Dirichlet Processes", and Erik Sudderth's PhD thesis, chapter 2.
Guangjian: "I find your matlab code for DP mixture models, I want to test the cluster
property of DP mixture models. But, when I use the code, I got some
errors(your example is ok), I want to fix the problem. But I don't know some
variables meanings in your program. Just like the following params."
params(1).alpha = T / 50; %1 / wishrnd(1,1);
J: concentration parameter -- see any tutorial on DPMMs, e.g. Rasmussen
params(1).kappa = .1; %T / 1000; %a pseudo count on the mean
J: Essentially, how much to trust the prior on the mean.
params(1).nu = 6; %a pseudo-count on the covariance
J: how much to trust the prior on the covariance
params(1).initmean = allmean;
J: prior on the mean of each cluster
params(1).initcov = allcov / 10;
J: prior on the covariance of each cluster
params(1).num_classes = 0;
J: system variable to keep track of the number of clusters generated
params(1).counts = 0;
params(1).sums = [];
params(1).cholSSE = [];
J: these are sufficient statistics for the cluster centers that can be incrementally updated. the mean of a cluster equals its sum divided by its count. The cholSSE variable is the cholesky decomposition of the covariance matrix.
params(1).classes = ones(T,1);
J: assignment of instances to clusters
% params(1).SSE = [];
params(1) = addNewClass(params(1));
J: initializes the first cluster.
params(1) = unhideObservations(params(1), 1, data);
J: assigns all observations to the first cluster
----
Good luck, and please post questions to the blog.
--Jacob
Comments:
Links to this post:
<< Home
Hi Jacob,
I just managed to run it by running
install_lightspeed in the lightspeed directory.
Thanks again!
Regards,
Eehui
I just managed to run it by running
install_lightspeed in the lightspeed directory.
Thanks again!
Regards,
Eehui
Yucel says: "I again setpath the two toolbox but it doesn't work. Actually I dont undestant how you setpath subfolder of the tools using commend windoev comment addpath(..),I setpath the tools from file options of the matlab. The problem can come form the version of BNT, besause current version of the tool is 1.0.4"
Jacob says: "I tried it with BNT 1.0.4 and it seems to work for me. See Kevin Murphy's info on installing BNT, that might be the problem. Here's what I run:
>> cd ~/drg/lib/FullBNT-1.0.4/
>> addpath(genpathKPM(pwd))
>> addpath('~/drg/lib/lightspeed/')
>> cd ~/public_html/software/dpmm/
>> demodpmm
Please try this and let me know if it doesn't work."
Jacob says: "I tried it with BNT 1.0.4 and it seems to work for me. See Kevin Murphy's info on installing BNT, that might be the problem. Here's what I run:
>> cd ~/drg/lib/FullBNT-1.0.4/
>> addpath(genpathKPM(pwd))
>> addpath('~/drg/lib/lightspeed/')
>> cd ~/public_html/software/dpmm/
>> demodpmm
Please try this and let me know if it doesn't work."
in your demo, why you use the last params, why params has 101 columns?
scatterMixture(Y,params(end).classes);
I ran your demo sucessfully, but it seems that all the class in each params is 1, so I guess the data are not clustered.
Can you help to explain? Thanks!
scatterMixture(Y,params(end).classes);
I ran your demo sucessfully, but it seems that all the class in each params is 1, so I guess the data are not clustered.
Can you help to explain? Thanks!
I ran the demo successfully, but i am not sure why you use the last params to display, and why the columns of the params is 101....
scatterMixture(Y,params(end).classes);
My another problem is why the results of classes in params are all 1, it imply that all the data generately by drawGmm function is not well clustered.
Thanks!
scatterMixture(Y,params(end).classes);
My another problem is why the results of classes in params are all 1, it imply that all the data generately by drawGmm function is not well clustered.
Thanks!
The params matrix contains one element per sampling iteration. There are 101 elements because demodpmm.m does 100 iterations of sampling, plus the initial state. I display the last iteration just to visualize these results, but you may want to average over multiple iterations depending on your application.
As for why all the values in params(end).classes are equal to 1 -- I don't know, this isn't happening when I run it. You might just be getting unlucky. Does it happen every time?
Post a Comment
As for why all the values in params(end).classes are equal to 1 -- I don't know, this isn't happening when I run it. You might just be getting unlucky. Does it happen every time?
Links to this post:
<< Home

