Skip to content

Comments

Better error message for Mass matrix contains zeros#2977

Merged
twiecki merged 5 commits intopymc-devs:masterfrom
junpenglao:Better_error_msg
May 17, 2018
Merged

Better error message for Mass matrix contains zeros#2977
twiecki merged 5 commits intopymc-devs:masterfrom
junpenglao:Better_error_msg

Conversation

@junpenglao
Copy link
Member

We see user having a hard time debugging their model when the error Mass matrix contains zeros on the diagonal. Some derivatives might always be zero arise. See eg https://discourse.pymc.io/t/unsupervised-clustering-mass-matrix-contains-zeros-on-the-diagonal/1222/.

This PR prints out where the error is, so user can easier address the bug by eg changing the scale of those RVs

We see user having a hard time debugging their model when the error `Mass matrix contains zeros on the diagonal. Some derivatives might always be zero` arise. See eg https://discourse.pymc.io/t/unsupervised-clustering-mass-matrix-contains-zeros-on-the-diagonal/1222/.

This PR prints out where the error is, so user can easier address the bug by eg changing the scale of those RVs
@twiecki
Copy link
Member

twiecki commented May 16, 2018

This is huge! Can you paste an example output?

Junpeng Lao added 2 commits May 16, 2018 15:41
@junpenglao
Copy link
Member Author

screen shot 2018-05-16 at 4 02 19 pm

Any suggestion on the wording?

@junpenglao
Copy link
Member Author

junpenglao commented May 16, 2018

Maybe it is more compact to say:
'The derivative of RV ``center``[0] is zero.' using [0] to indicate the index

@springcoil
Copy link
Contributor

springcoil commented May 16, 2018 via email

@springcoil
Copy link
Contributor

springcoil commented May 16, 2018 via email

Junpeng Lao added 2 commits May 16, 2018 16:29
the index is after .ravel()
@twiecki twiecki merged commit f39b1e2 into pymc-devs:master May 17, 2018
@junpenglao junpenglao deleted the Better_error_msg branch May 17, 2018 10:14
junpenglao pushed a commit that referenced this pull request May 29, 2018
* Better error message for NaN occurred in optimization

Similar to #2977, this PR prints out where NaN occurred with potential strategy of how to debug it.

* Add release note
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

Successfully merging this pull request may close these issues.

3 participants