Closed zanussbaum closed 3 years ago
Hi @zanussbaum I assume you ran it with verbose=True
, just to check first (says False
above)? We can try to repro!
Oops yes I copied the wrong code snippet. Just retried with verbose=True and still not working. However adding
logger = logging.getLogger()
logger.setLevel(logging.INFO)
seems to fix the problem. Is this an error on Jupyter's end then?
Hi @bhancock8, @vincentschen, I checked this issue, and looks like it is not specific to Jupyter. Even when running the code on my local machine I had to specifically set the logging level to INFO
, to be able to see the loss logs. The default level is WARNING
. If required, I can fix it by changing the log level in _set_logger()
method when check()
returns True and verbose
is also True
. Please let me know if I should proceed with this.
That's sounds reasonable. If verbose=True, then we can set the logging level for the label model's logger to be at INFO rather than WARNING. If you can make that change in a PR and tag me, I'd be happy to review and get that merged!
Issue description
When calling LabelModel.fit() (with a verbose LabelModel), there is no output to the cell on the loss of the model. Is this expected because of errors in Jupyter? Are there any workarounds? It's tougher to gauge how well the model is doing and to tune it accordingly. Would it be possible to instead return the loss from fit() like some frameworks do?
Code example/repro steps
label_model = LabelModel(cardinality=2, verbose=False)
label_model.fit(L_train=L_train, n_epochs=100, log_freq=10, seed=123, lr=3e-5)
Expected behavior
Loss printed out 10 times (100 / 10)
System info