Skip to content

Commit

Permalink
fixing broken fastai callback, it was logging the loss during the val…
Browse files Browse the repository at this point in the history
…idation phase. (#63)

* fix broken fastai callback
  • Loading branch information
i008 authored and jakubczakon committed Oct 14, 2019
1 parent e94fe90 commit b395621
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neptunecontrib/monitoring/fastai.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ def on_epoch_end(self, **kwargs):
metric_name = getattr(metric_name, '__name__', metric_name)
self._exp.send_metric(self._prefix + str(metric_name), float(metric_value))

def on_batch_end(self, **kwargs):
self._exp.send_metric('{}last_loss'.format(self._prefix), float(kwargs['last_loss']))
def on_batch_end(self, last_loss, iteration, train, **kwars):
if iteration == 0 or not train:
return
self._exp.send_metric('{}last_loss'.format(self._prefix), last_loss)

0 comments on commit b395621

Please sign in to comment.