-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
WIP: Add tt.nnet.softmax to math (#4226) #4229
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4229 +/- ##
==========================================
- Coverage 88.95% 88.94% -0.01%
==========================================
Files 92 92
Lines 14806 14808 +2
==========================================
+ Hits 13170 13171 +1
- Misses 1636 1637 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start, thanks @ricardoV94 !
This PR does not address the current deprecation warning when using the softmax function. Perhaps this should be solved before adding it?
Yeah probably, but first: what do you mean by "the current deprecation warning"? And what version of Theano (or even Theano-PyMC) are you on?
I assumed that no new tests would be needed, since this is just a wrapper to the theano function. Is there anything else that should be done?
I think a few tests would be good to have: maybe just spot some tests where the theano softmax is used and replace it with the new pm.math.softmax
?
Thanks for the feedback!
I am using Theano-PyMC 1.0.11. The softmax usually gives this warning:
It is raised in these two places: In fact a custom softmax function is currently implemented in the StickBreaking Transform to go around this limitation / avoid the warning: https://github.com/pymc-devs/pymc3/blob/a05684b9588208882db164be113954eb21604ea1/pymc3/distributions/transforms.py#L463
I couldn't find any PyMC3 tests that are using the theano softmax. In fact, it seems that the theano function is not used anywhere in the library. As in the example above, it is always implemented on the spot: In any case I can add new tests, similar to what is already being done with the theano log1pexp function. The only doubt I have, is whether the Warning is a big issue or not. |
Thanks for this detailed review @ricardoV94 ! This raises several points, but the main one is probably that we should replace the current Theano implementation of the Once this part is done, giving access to softmax through PyMC will be super straightforward: in the |
FYI, I opened an issue on Theano-PyMC: aesara-devs/aesara#183 |
Thanks @AlexAndorra! |
@ricardoV94 given the upcoming In my opinion What do you think? |
We can close this in favor of the issue that is open in aesara |
This PR is a straightforward proposal to give access to the tt.nnet.softmax via the pm.math module.
This PR does not address the current deprecation warning when using the softmax function. Perhaps this should be solved before adding it?
I assumed that no new tests would be needed, since this is just a wrapper to the theano function. Is there anything else that should be done?