Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix flaky tests for test_hinge_loss
Browse files Browse the repository at this point in the history
  • Loading branch information
zachgk committed Aug 3, 2018
1 parent bcfab3a commit 24bbd94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/python/unittest/test_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ def test_huber_loss():
assert mod.score(data_iter, eval_metric=mx.metric.Loss())[0][1] < 0.05


@with_seed(1234)
# @zachgk: Getting ride of fixed seed as flakiness should not occur with increased tolerance,
# tracked at https://github.com/apache/incubator-mxnet/issues/11695
@with_seed()
def test_hinge_loss():
N = 20
data = mx.random.uniform(-1, 1, shape=(N, 10))
Expand All @@ -307,7 +309,7 @@ def test_hinge_loss():
mod.fit(data_iter, num_epoch=200, optimizer_params={'learning_rate': 0.01},
initializer=mx.init.Xavier(magnitude=2), eval_metric=mx.metric.Loss(),
optimizer='adam')
assert mod.score(data_iter, eval_metric=mx.metric.Loss())[0][1] < 0.05
assert mod.score(data_iter, eval_metric=mx.metric.Loss())[0][1] < 0.06


@with_seed(1234)
Expand Down

0 comments on commit 24bbd94

Please sign in to comment.