Code Monkey home page Code Monkey logo

mixed-membership-stochastic-blockmodel's People

Contributors

aburnap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mixed-membership-stochastic-blockmodel's Issues

Loading data needs to specify delimiter and variable node set in MCMC sampler is empty

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 .

1. Data file is not loaded correctly.

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 = ",")

2. MCMC model is empty

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

.....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.