-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix mathematical notation in conditional_logprob docstrings #6821
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
Fix mathematical notation in conditional_logprob docstrings #6821
Conversation
@larryshamalama I have followed your suggestions in the issue #6798 but I am not sure if the way I represented the line L438 is correct: In the lines L448-L449 I shifted the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6821 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 95 95
Lines 16261 16262 +1
=======================================
+ Hits 14967 14968 +1
Misses 1294 1294
|
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.
Thanks @amyoshino for opening this PR, you're on a roll!
Apologies if the initial issue was confusing. I wrote a long text ahead, none of this is major but rather a clarification of what I previously meant. I can get quite picky with mathematical notation...
@larryshamalama I have followed your suggestions in the issue #6798 but I am not sure if the way I represented the line L438 is correct: logp(Y=y∣Σ2) --> logpY∣s2(y∣s2). It looks odd to me because I am repeating the s in the subscript and in the conditional side. Let me know if this is not the best way to represent it.
Your instinct is correct, we shouldn't have s as a subscript (random variable) and as an argument (value variable). In the hierarchical model definition, we just want random variables. In the mathematical function representing the log-density, arguments are the "value variables". I hope that this clarifies things.
We ideally want to adopt a notation that is more "standard" and easier to understand. That's mostly subjective... 1) I prefer using
It seems that you use sigma2_rv
to be the PyTensor random variable and s_vv
to be the valued variable. (*) We should probably even write s2_vv
instead of s_vv
. If you have any preferences, you can add your suggestion. Otherwise, I provided mine in this review.
In short, your instinct correctly addresses an error in mathematical notation, but the solution can be entirely subjective. Actionable items are presented by a (*) for clarity :)
Accepting change in s. It becomes sigma Co-authored-by: larryshamalama <[email protected]>
Accepting change in s. It becomes sigma part 2 Co-authored-by: larryshamalama <[email protected]>
Co-authored-by: larryshamalama <[email protected]>
@larryshamalama thank you for the comments and review! I think it makes way more sense to me now, my apologies for not making sense of your initial comments and changing the use of I have commited your suggestions and added a last commit to cover the changes from I think everything is ok now, but let me know if I forgot to address anything or if you have any other suggestions or comments. |
Ah please don't be sorry, I'm very happy to help :)
Don't worry about the number of commits! We often squash merge, but there is a certain "art" to writing nice commits. I'm still learning myself, @ricardoV94 writes great commits if you want to have some inspiration. Around the beginning of my open-source involvement, I was referred to this website, which I found somewhat helpful: https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes |
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 good, thanks @amyoshino!
@larryshamalama Thank you for your guidance!! Thanks for also pointing out resources for me to improve, I found the linked document very informative, will carry it to the next PRs as best as I can. |
What is this PR about?
Closes #6798
This PR Fix mathematical notation in
conditional_logprob
docstringsThe changes are pointed out by @larryshamalama in #6798. The notation changes are:
Checklist
Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance
📚 Documentation preview 📚: https://pymc--6821.org.readthedocs.build/en/6821/