-
Notifications
You must be signed in to change notification settings - Fork 128
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
RatioEstimator abstraction #1097
base: main
Are you sure you want to change the base?
Conversation
I added a test. it's extremely simple, but it checks that the estimated ratios are the correct size . (like |
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.
I will follow up after Friday. |
@tomMoral I think this is done now. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
==========================================
- Coverage 85.26% 77.25% -8.02%
==========================================
Files 89 90 +1
Lines 6616 6629 +13
==========================================
- Hits 5641 5121 -520
- Misses 975 1508 +533
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
A few extra comments but overall it looks good!
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.
Hi Ben,
thanks a lot! The shape-PR for DensityEstimator
s is finally merged in #1066 so we can start pushing this along. See a few questions below.
"theta_shape", ((1,), (2,), (1, 1), (2, 2), (1, 1, 1), (2, 2, 2)) | ||
) | ||
@pytest.mark.parametrize("x_shape", ((1,), (2,), (1, 1), (2, 2), (1, 1, 1), (2, 2, 2))) | ||
def test_api_ratio_estimator(ratio_estimator, theta_shape, x_shape): |
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.
Please add a test that checks if 2D data (images) can be handled with appropriate embedding nets.
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 for pushing this along! 👏
I think it makes sense that @michaeldeistler reviews this.
There is a wip push, but supporting sample dim will require:
|
goals:
|
What does this implement/fix? Explain your changes
It introduces a
RatioEstimator
abstraction. It will wrap neural networks that processx
andtheta
to estimate ratios. The base class is suggestive of how to create extensions that use alternative data types (dict
, etc.) while flexible enough to handle how embedding works and how embedded data is combined. Natural extensions include ratio estimators with specific network architectures such as transformers or convnets.This implements #992 which is the ratio specific issue for #1046. It also implements the ratio part of #957 and makes the documentation confirm to the shape goals of #1041.
Does this close any currently open issues?
Closes:
#992
Also #1036 since it eliminates a confusingly name and now-irrelevant class.
The others are more general and require more work on subjects related to ratios before closing.
Any relevant code examples, logs, error output, etc?
Nope
Any other comments?
There is a test that doesn't pass, namely #1090, but I think it is not because of my changes.
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
guidelines
with
pytest.mark.slow
.guidelines
main
(or there are no conflicts withmain
)