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

Adding meta-information for MeasurableOps #7076

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Dhruvanshu-Joshi
Copy link
Contributor

@Dhruvanshu-Joshi Dhruvanshu-Joshi commented Dec 24, 2023

Description

This PR aims to solve issue #6360 and is a cotinuation of the PR #6685 and PR #6754 by incorporating RV meta information in intermediate MeasurableVariables. The Measurable ops covered are MeasurableComparison, MeasurableClip, MeasurableRound, MeasurableSpecifyShape, MeasurableCheckAndRaise, MeasurableIfElse, MeasurableScan, MeasurableMakeVector, MeasurableJoin, MeasurableDimShuffle, MeasurableTransforms and DiracDelta.

cc: @ricardoV94 @larryshamalama

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7076.org.readthedocs.build/en/7076/

Copy link

codecov bot commented Dec 24, 2023

Codecov Report

Attention: Patch coverage is 30.90909% with 114 lines in your changes are missing coverage. Please review.

Project coverage is 63.23%. Comparing base (4f6831e) to head (7157900).
Report is 1 commits behind head on main.

❗ Current head 7157900 differs from pull request most recent head ddcda2f. Consider uploading reports for the commit ddcda2f to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #7076       +/-   ##
===========================================
- Coverage   92.30%   63.23%   -29.08%     
===========================================
  Files         100      100               
  Lines       16895    16990       +95     
===========================================
- Hits        15595    10743     -4852     
- Misses       1300     6247     +4947     
Files Coverage Δ
pymc/logprob/transforms.py 55.38% <0.00%> (-40.08%) ⬇️
pymc/logprob/cumsum.py 38.23% <50.00%> (-52.95%) ⬇️
pymc/logprob/censoring.py 61.22% <62.50%> (-34.48%) ⬇️
pymc/logprob/binary.py 28.88% <0.00%> (-65.43%) ⬇️
pymc/logprob/checks.py 38.88% <42.85%> (-51.86%) ⬇️
pymc/logprob/abstract.py 80.26% <70.58%> (-15.20%) ⬇️
pymc/logprob/scan.py 16.82% <13.33%> (-80.71%) ⬇️
pymc/logprob/tensor.py 25.78% <23.52%> (-51.08%) ⬇️
pymc/logprob/order.py 27.61% <23.52%> (-66.99%) ⬇️
pymc/logprob/mixture.py 19.84% <7.31%> (-76.23%) ⬇️

... and 65 files with indirect coverage changes

*args,
ndim_supp: Union[int, Tuple[int]],
supp_axes: Tuple[Union[int, Tuple[int]]],
measure_type: Union[MeasureType, Tuple[MeasureType]],
Copy link
Member

Choose a reason for hiding this comment

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

Should not that be a frozenset or some collection? Union requires if else later, does not it?

Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what you mean in more detail?

@ricardoV94
Copy link
Member

@Dhruvanshu-Joshi do you have a chance to update the PR to fix the conflicts? Otherwise was anything missing?

@Dhruvanshu-Joshi
Copy link
Contributor Author

No there was not any feature missing to be added. I'll solve the conflicts and push the updates asap.

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Small comment. Otherwise looks good to me. Pre-commit seems to be unhappy though

Comment on lines +205 to +206
if len(base_var.owner.outputs) != len(base_op.ndim_supp):
raise NotImplementedError("length of outputs and meta-properties is different")
Copy link
Member

Choose a reason for hiding this comment

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

This is too restrictive for Scan, which can have recurrent outputs that are not measurable variables. Let's just remove it for now?

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.

None yet

3 participants