Skip to content

Commit

Permalink
Another bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
csxeba committed Mar 4, 2020
1 parent b0ade67 commit 0b0a6e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion brainforge/learner/abstract_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ def evaluate_batch(self, x, y, metrics=()):
def evaluate_stream(self, stream, steps, metrics=(), verbose=False):
history = logging.MetricLogs.from_metric_list(steps, ["cost"], metrics)
metrics = [_metrics.get(metric) for metric in metrics]
for x, y in stream:
for i, (x, y) in enumerate(stream, start=1):
eval_metrics = self.evaluate_batch(x, y, metrics)
history.record(eval_metrics)
if verbose:
history.log("\r", end="")
if i >= steps:
break
if verbose:
print()
history.reduce_mean()
Expand Down

0 comments on commit 0b0a6e0

Please sign in to comment.