Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Fix for stability condition for tests to pass as before.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed Nov 17, 2015
1 parent 9cc3f25 commit 0d13b16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sknn/mlp.py
Expand Up @@ -132,15 +132,15 @@ def _train(self, X, y):
raise RuntimeError("Training diverged and returned NaN at batch %i." % batches)

best_train_error = min(best_train_error, avg_train_error)
best_train = bool(avg_train_error / best_train_error < (1.0 + self.f_stable))
best_train = bool(avg_train_error <= best_train_error * (1.0 + self.f_stable))

best_valid = True
best_valid = False
avg_valid_error = None
if self.valid_set is not None:
avg_valid_error = self._backend._valid_impl(*self.valid_set)
if avg_valid_error is not None:
best_valid_error = min(best_valid_error, avg_valid_error)
best_valid = bool(avg_valid_error / best_valid_error < (1.0 + self.f_stable))
best_valid = bool(avg_valid_error <= best_valid_error * (1.0 + self.f_stable))

log.debug("\r{:>5} {}{}{} {}{}{} {:>5.1f}s".format(
i,
Expand Down

0 comments on commit 0d13b16

Please sign in to comment.