snorkel-team / snorkel

A system for quickly generating training data with weak supervision
https://snorkel.org
Apache License 2.0
5.81k stars 857 forks source link

fixed lambda LR saving bug #1661

Closed humzaiqbal closed 2 years ago

humzaiqbal commented 3 years ago

Description of proposed changes

This PR fixes a probelm with the LambaLR scheduler in which label models trained with it can't be serialized properly because it uses a lambda function which pickle doesn't save. I fixed it by changing the scheduler to be class based using this as reference https://stackoverflow.com/questions/52758051/how-to-save-lambdalr-scheduler-in-pytorch-with-lambda-function

Related issue(s)

https://github.com/snorkel-team/snorkel/issues/1658 Fixes # (issue)

Test plan

I added a UT where I set a label model using this scheduler and ensured that now it can be saved

Checklist

Need help on these? Just ask!

github-actions[bot] commented 2 years ago

This pull request is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.