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

Add HMM-constructing helper functions and Ops #130

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

brandonwillard
Copy link
Member

This PR adds HMM constructor functions and an OpFromGraph example for a discrete Markov chain. The latter demonstrates how "composite" measurable Ops can be used in AePPL, and the former shows how simple constructor functions that make use of our automatic log-probability derivations can be used to construct interfaces for more advanced models.

Once #75 goes through, we can remove the composite Op approach involving DiscreteMarkovChainFactor, but—in the meantime—it serves as a good example.

Also, these additions will complement an upcoming implementation of aesara-devs/aemcmc#6.

@brandonwillard brandonwillard force-pushed the add-hmm-dists branch 2 times, most recently from 651f6c4 to 423c15e Compare April 4, 2022 19:34
@ricardoV94
Copy link
Contributor

Quite interesting. Did you find any issues with scan + rng?

@brandonwillard
Copy link
Member Author

brandonwillard commented Apr 4, 2022

Quite interesting. Did you find any issues with scan + rng?

Scan can be used to generate a log-probability for models like this right now, but, without #75 in place, the stochastic state sequence inputs can't be defined anywhere except inside the Scan.

@brandonwillard brandonwillard self-assigned this Apr 4, 2022
@brandonwillard brandonwillard added enhancement New feature or request op-probability Involves the implementation of log-probabilities for Aesara `Op`s labels Apr 4, 2022
@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #130 (441ce60) into main (a97a6bc) will increase coverage by 94.27%.
The diff coverage is 93.42%.

@@            Coverage Diff            @@
##           main     #130       +/-   ##
=========================================
+ Coverage      0   94.27%   +94.27%     
=========================================
  Files         0       11       +11     
  Lines         0     1606     +1606     
  Branches      0      228      +228     
=========================================
+ Hits          0     1514     +1514     
- Misses        0       51       +51     
- Partials      0       41       +41     
Impacted Files Coverage Δ
aeppl/printing.py 89.68% <ø> (ø)
aeppl/dists.py 94.11% <91.93%> (ø)
aeppl/logprob.py 98.80% <100.00%> (ø)
aeppl/transforms.py 94.49% <0.00%> (ø)
aeppl/abstract.py 100.00% <0.00%> (ø)
aeppl/truncation.py 98.43% <0.00%> (ø)
aeppl/mixture.py 98.02% <0.00%> (ø)
aeppl/opt.py 81.41% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a97a6bc...441ce60. Read the comment docs.

@brandonwillard brandonwillard merged commit f5c1613 into aesara-devs:main Apr 4, 2022
@brandonwillard brandonwillard deleted the add-hmm-dists branch April 4, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request op-probability Involves the implementation of log-probabilities for Aesara `Op`s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants