-
Notifications
You must be signed in to change notification settings - Fork 9
Add generic observation processes which combine the convolution with the noise model. #644
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 96.98% 97.26% +0.27%
==========================================
Files 42 47 +5
Lines 1094 1278 +184
==========================================
+ Hits 1061 1243 +182
- Misses 33 35 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you for your contribution @cdc-mitzimorris 🚀! Your github-pages is ready for download 👉 here 👈! |
…ents, 'aggregate' instead of 'jurisdiction'
…ents, 'aggregate' instead of 'jurisdiction'
for more information, see https://pre-commit.ci
… into mem_generic_observations
for more information, see https://pre-commit.ci
… into mem_generic_observations
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
… into mem_generic_observations
…randomvariable/hierarchical.py), per reviewer comments
|
ready for re-review - high-level concerns addressed:
|
|
In preparing to add the |
| expected_counts_safe = jnp.nan_to_num(expected_counts, nan=0.0) | ||
| predicted_counts = self._predicted_obs(infections) | ||
| self._deterministic("predicted_counts", predicted_counts) | ||
| predicted_counts_safe = jnp.nan_to_num(predicted_counts, nan=0.0) |
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.
^ This feels dangerous to do automatically and without warning. I think I would rather force the user to do it themself in _predicted_obs, where appropriate. Is there a good reason not to?
| """ | ||
| predicted_values = self._predicted_obs(infections) | ||
|
|
||
| self._deterministic("predicted_log_conc", predicted_values) |
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.
Site name should be configurable and/or dynamically generated based on a higher-level configurable name.
| predicted_obs = predicted_values[times, subpop_indices] | ||
|
|
||
| observed = self.noise.sample( | ||
| name="concentrations", |
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.
Should be configurable and/or dynamically generated based on a higher-level configurable name.
dylanhmorris
left a comment
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 @cdc-mitzimorris! A few things to address and then I can re-review.
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
This PR adds work that was done in https://github.com/cdcent/cfa-pyrenew-hierarchical/pull/4 to PyRenew.
It adds the base observation process class, concrete implementations for Count processes and the abstract base class for Measurement processes, together with unit tests and two new tutorials for count and measurement observation processes respectively.
Once this PR and the work done in https://github.com/cdcent/cfa-pyrenew-hierarchical/pull/5 have been added to PyRenew, subsequent PRs will deprecate unused features and harmonize the documentation and tutorials.