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

Add tqdm progress bar on label fit method #1649

Closed anerirana closed 3 years ago

anerirana commented 3 years ago

Fixes #1624

Description of proposed changes

Added a tqdm progress bar when fit() method on LabelModel is called. It updates after each epoch.

tqdm2

When log frequency for loss reporting is enabled, it will be formatted this way.

tqdm3

Please let me know if I should add a progress_bar parameter to fit(), similar to apply() method in PandasLFApplier

Related issue(s)

Fixes #1624

Test plan

No new test has been added, as these changes do not modify the logic

Checklist

Need help on these? Just ask!

codecov[bot] commented 3 years ago

Codecov Report

Merging #1649 (d39c6e9) into master (b3b0669) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1649   +/-   ##
=======================================
  Coverage   97.31%   97.31%           
=======================================
  Files          68       68           
  Lines        2157     2163    +6     
  Branches      348      350    +2     
=======================================
+ Hits         2099     2105    +6     
  Misses         30       30           
  Partials       28       28           
Impacted Files Coverage Δ
snorkel/labeling/model/label_model.py 96.38% <100.00%> (+0.07%) :arrow_up:
anerirana commented 3 years ago

@bhancock8, @brahmaneya, requesting a review for this PR

anerirana commented 3 years ago

@bhancock8, @brahmaneya, requesting a review for this PR

@paroma @fredsala

bhancock8 commented 3 years ago

Thank you for this PR contribution, @anerirana! (And apologies for the delay—I was out of office this past week). Yes, I think adding a progress_bar parameter is an excellent idea, to provide an escape hatch for situations where it may become too verbose to be helpful or otherwise interfere with the output of script-based usage. After that, this should be good to go. Just re-ping (re-request review) from me when that's done and I'll be happy to approve.

anerirana commented 3 years ago

@bhancock8, thanks for the review. Added the progress bar parameter as discussed.

anerirana commented 3 years ago

Excellent. Thanks for the edit and new unit test. Good to merge!

@bhancock8 I don't have write access to this repository, you will have to merge the PR.