Skip to content

Transformed variable failure during Metropolis sampling #1235

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

Closed
fonnesbeck opened this issue Jul 12, 2016 · 5 comments
Closed

Transformed variable failure during Metropolis sampling #1235

fonnesbeck opened this issue Jul 12, 2016 · 5 comments

Comments

@fonnesbeck
Copy link
Member

I've come across a curious error related to using transformed variables in Metropolis sampling. Specifically, a MissingInputError is raised when sample is called. Replacing the variable in question with a constant results in the next transformed variable failing for the same reason.

Here is an example of a model that fails because of this

BTW, setting exception_verbisity to "high" does nothing to improve the verbosity of the output.

@twiecki
Copy link
Member

twiecki commented Jul 13, 2016

Did this stop working after #1215 was merged?

@fonnesbeck
Copy link
Member Author

I don't know, as this is a new model, but it seems unlikely since transformations have always been renamed to something. I will try it though.

@fonnesbeck
Copy link
Member Author

Verified that this is not the issue. After reverting to before the pull request was merged:

MissingInputError: An input of the graph, used to compute Elemwise{exp,no_inplace}(cold_mort_interval), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.

NUTS also fails, but because it receives NaNs in the gradient. So, I believe something deeper is the issue.

@fonnesbeck
Copy link
Member Author

fonnesbeck commented Jul 17, 2016

Running the same model with ADVI yields:

NullTypeGradError: tensor.grad encountered a NaN. This variable is Null because the grad method 
for input 3 (Elemwise{true_div,no_inplace}.0) of the RandomFunction{multinomial_helper} op is 
mathematically undefined. No gradient defined through raw random numbers op

@twiecki
Copy link
Member

twiecki commented Jul 18, 2016

It's quite a complex model it seems, perhaps try to work backwards?

@twiecki twiecki closed this as completed Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants