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

Vectorize differenced process #446

Merged
merged 8 commits into from
Sep 18, 2024
Merged

Conversation

dylanhmorris
Copy link
Collaborator

@dylanhmorris dylanhmorris commented Sep 16, 2024

This PR:

  • refactors DifferencedProcess to be compatible with vectorized input
  • Moves integration of discrete timeseries to its own helper function integrate_discrete(), in pyrenew.math, which DifferencedProcess calls under the hood.
  • Adds tests for multidimensional input, including checks that appropriate and informative errors are raised.
  • Changes from using numpyro.contrib.control_flow.scan to jax.lax.scan in the integrator, since it's fully deterministic.

Out of scope but planned

  • Helper functions for broadcasting / shape checking / etc for multi-dim array dimensions after the first, where the first dimension is time and is scanned along

@dylanhmorris dylanhmorris linked an issue Sep 16, 2024 that may be closed by this pull request
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.40%. Comparing base (afbb340) to head (53740d8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pyrenew/process/differencedprocess.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   94.26%   94.40%   +0.14%     
==========================================
  Files          42       42              
  Lines         994     1001       +7     
==========================================
+ Hits          937      945       +8     
+ Misses         57       56       -1     
Flag Coverage Δ
unittests 94.40% <96.96%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…shape determination and associated error messages, add manually computed tests in multiple dimensions
@dylanhmorris dylanhmorris changed the title Vectorized differenced process that passes all relevant existing tests Vectorize differenced process Sep 17, 2024
@dylanhmorris dylanhmorris marked this pull request as ready for review September 17, 2024 21:53
@damonbayer
Copy link
Collaborator

Out of scope but planned

  • Helper functions for broadcasting / shape checking / etc for multi-dim array dimensions after the first, where the first dimension is time and is scanned along

Is there an issue for this?

@dylanhmorris
Copy link
Collaborator Author

Created #451

@damonbayer
Copy link
Collaborator

Could be good to have a test that makes use of both the vectorized differenced process and the vectorized AR process to make sure they work together. Perhaps as a test for rtperiodicdiffar. Could be done here or as part of #419

@sbidari
Copy link
Collaborator

sbidari commented Sep 18, 2024

Changes here look good to me!

@dylanhmorris dylanhmorris mentioned this pull request Sep 18, 2024
3 tasks
@dylanhmorris dylanhmorris merged commit 6e9fd3f into main Sep 18, 2024
8 checks passed
@dylanhmorris dylanhmorris deleted the 442-vectorize-differencedprocess branch September 18, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vectorize DifferencedProcess
3 participants