aburnap / mixed-membership-stochastic-blockmodel Goto Github PK
View Code? Open in Web Editor NEWMixed Membership Stochastic Blockmodel Implementation with 3 Inference Schemes
Mixed Membership Stochastic Blockmodel Implementation with 3 Inference Schemes
Hi,
first thanks for making this PyMC implementation of the MMSB available! It is very helpful to get started with implementing latent space models in PyMC.
I have downloaded the code and tried to run the example in MMSB_run.py
I have encountered the following problems.
I am using python version 2.7.3-0ubuntu7.1
and numpy version 1:1.6.2-1ubuntu1 .
The data file in the example does not get loaded with the existing code. The problem is that numpy splits values on whitespace by default and the text file uses comma (,).
The problem is easily fixed by specifying the delimiter explicitly:
data_matrix=np.loadtxt("../data/Y_alpha0.1_K5_N20.txt", delimiter = ",")
When running the mcmc sampler for the MMSB, the set of variables in the MCMC model seems to be empty!! The sampler runs through without error messages (even very fast) but does not seem to do anything. As a result there is no output statistics after the sampling.
Here is the step-by-step code that I execute to create the sampler class and run it.
From MMSB_run.py :
$ raw_model = model.create_model(data_matrix, num_people, num_groups, alpha, B)
$ MC_model = pymc.Model(raw_model)
$ print MC_model.nodes // There are variables here
set([<pymc.distributions.Multinomial 'z_3T4_vector' at 0x6163a10>, <pymc.distributions.Multinomial 'z_12T17_vector' at 0x6978050>, <pymc.distributions.Multinomial 'z_16T3_vector' at 0x6c9f4d0>, <pymc.distributions.Multinomial 'z_12T3_vector' at......
$ M = pymc.MCMC(model)
$ print M.nodes // Suddenly there are NO variables in M ??!!!
set([])
$ M.sample(10000,500, thin=5)
[_100%_**] 10000 of 10000 complete
$ pymc.Matplot.plot(M)
// no output here
$ M.summary()
// no output here either
I have not been able to fix the problem yet. Any help would be appreciated.
Thanks,
Daniel
.....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.