New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inefficient sampling of large categorical model #1018

Closed
junpenglao opened this Issue Mar 13, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@junpenglao
Member

junpenglao commented Mar 13, 2016

I have been trying to implement a large categorical model in pymc3 but without much progress. The model I am trying to implement is detailed in the last chapter of Lee and Wagenmakers' Bayesian Cognitive Modeling book.

In brief, each entry of the response data is generated by a different categorical pdf (constructed under some hierarchical constraints).Thus the probability vector of these categorical pdf is trial/subject specific. I have the following difficulties:

1, The model is very slow. I adapted the codes from the book (JAGS and STAN), both end up too many nodes for Theano. I hadn't manage to sample using NUTS - it took too long to compile.
2, I can use Metropoli as step method but the sampling of categorical parameter is incorrect (the trace is nearly uniform). I also try pymc2 but the problem remains.

Is there a working example of a similar problem? Or how should I build my model in this case (e.g., categorical response with a large sets of priors) to make it more efficient?

All my attempts could be found here: https://github.com/junpenglao/Bayesian-Cognitive-Modeling-in-Pymc3/blob/master/CaseStudies/NumberConceptDevelopment.ipynb

edit: this might relate to #624

@junpenglao

This comment has been minimized.

Show comment
Hide comment
@junpenglao

junpenglao Apr 15, 2017

Member

Close as this problem is resolved using some matrix manipulations instead of creating large graph in theano.

Member

junpenglao commented Apr 15, 2017

Close as this problem is resolved using some matrix manipulations instead of creating large graph in theano.

@junpenglao junpenglao closed this Apr 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment