-
Notifications
You must be signed in to change notification settings - Fork 860
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
Accept prec_init as array or list #1616
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1616 +/- ##
==========================================
+ Coverage 97.21% 97.31% +0.10%
==========================================
Files 68 68
Lines 2151 2157 +6
Branches 345 348 +3
==========================================
+ Hits 2091 2099 +8
+ Misses 31 30 -1
+ Partials 29 28 -1
|
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 @antonis19 , thanks for the PR and apologies for the delay on reviewing. Added some comments. I'd also recommend updating the type of TrainConfig.prec_init
to a union type that allows all of the types we're now handling.
@henryre I took care of the comments you made. Now there seems to be a build error even though all the tests pass. It seems to me that these are errors related to the build configuration, or am I wrong? |
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 the updates! Taking a look at the build error now
The build issues should be resolved on trunk. Re-running for this PR: https://github.com/snorkel-team/snorkel/pull/1616/checks?check_run_id=1764471482 |
@henryre seems that all the tests are passing except for codecov/patch. What would we need to do to fix this? |
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.
@antonis19 the codecov issue is not clear to me, so happy to bypass it once the last comment is addressed!
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 so much for the contribution @antonis19 and your patience on the back-and-forth! Looking forward to getting this released!
## Description of proposed changes Currently, `LabelModel` only accepts a `float` or an `int` for `prec_init`. These get converted into a 1D tensor of the same value. In this pull request, `prec_init` can be passed as `np.ndarray` or as a Python list also. This way different labeling functions can get assigned different priors. ## Related issue(s) Fixes snorkel-team#1484 ## Test plan ## Checklist Need help on these? Just ask! * [ ✅ ] I have read the **CONTRIBUTING** document. * [ ✅ ] I have updated the documentation accordingly. * [ ✅ ] I have added tests to cover my changes. * [ ✅ ] I have run `tox -e complex` and/or `tox -e spark` if appropriate. * [ ✅ ] All new and existing tests passed.
Description of proposed changes
Currently,
LabelModel
only accepts afloat
or anint
forprec_init
. These get converted into a 1D tensor of the same value. In this pull request,prec_init
can be passed asnp.ndarray
or as a Python list also. This way different labeling functions can get assigned different priors.Related issue(s)
Fixes #1484
Test plan
Checklist
Need help on these? Just ask!
tox -e complex
and/ortox -e spark
if appropriate.