Skip to content
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

Logprob derivation for switch-encoding graphs #6834

Closed
wants to merge 14 commits into from

Conversation

shreyas3156
Copy link
Contributor

@shreyas3156 shreyas3156 commented Jul 19, 2023

What is this PR about?
This draft PR consists of the headway made in inferring the log-probability of switch-encoding expressions for the following cases:

  1. when both branches have an encoding constant,
x = pt.random.normal(0.3)
y = pt.switch(x > 0.5, 1, 2)
  1. when one of the two branches is measurable.
x = pt.random.normal(0.3)
y = pt.switch(x > 0.5, 1, x)

The pending challenges with the second case above include the following:

  1. Add calculation for the logprob when one of the branches is measurable,
  2. Get the pt.invert to go through the IR rewrite and convert to its Measurable counterpart.

@ricardoV94 @larryshamalama

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #6834 (dc50061) into main (14e673f) will decrease coverage by 4.64%.
Report is 59 commits behind head on main.
The diff coverage is 27.63%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6834      +/-   ##
==========================================
- Coverage   91.89%   87.26%   -4.64%     
==========================================
  Files          95       96       +1     
  Lines       16185    16518     +333     
==========================================
- Hits        14874    14415     -459     
- Misses       1311     2103     +792     
Files Changed Coverage Δ
pymc/logprob/censoring.py 44.65% <27.63%> (-54.23%) ⬇️

... and 36 files with indirect coverage changes

pymc/logprob/censoring.py Outdated Show resolved Hide resolved
pymc/logprob/censoring.py Outdated Show resolved Hide resolved
pymc/logprob/censoring.py Outdated Show resolved Hide resolved
pymc/logprob/censoring.py Outdated Show resolved Hide resolved
pymc/logprob/censoring.py Outdated Show resolved Hide resolved
Copy link
Member

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @shreyas3156 :) Some minor comments for now as you continue to make progress. Keep up the good work!

pymc/logprob/censoring.py Show resolved Hide resolved
pymc/logprob/censoring.py Show resolved Hide resolved
pymc/logprob/censoring.py Show resolved Hide resolved
@shreyas3156 shreyas3156 marked this pull request as ready for review August 14, 2023 02:53
@ricardoV94 ricardoV94 marked this pull request as draft August 24, 2023 11:29
@ricardoV94
Copy link
Member

Hey @shreyas3156 what's the status of the PR? Ready for review? There's some conflicts with main

@shreyas3156
Copy link
Contributor Author

Hey @shreyas3156 what's the status of the PR? Ready for review? There's some conflicts with main

This was the first draft PR which was supposed to be a draft for the main PR #6949 , which is ready for review. We can close this one.

@ricardoV94 ricardoV94 closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants