You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2019/04/03 01:55:45 UTC
[incubator-mxnet] branch master updated: Fix flaky test poisson
generator & test_negative_binomial_generator (#14571)
This is an automated email from the ASF dual-hosted git repository.
zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new a6fd0e9 Fix flaky test poisson generator & test_negative_binomial_generator (#14571)
a6fd0e9 is described below
commit a6fd0e9ac500e15a98a9e21a132fc14f75c6340d
Author: Jake Lee <gs...@gmail.com>
AuthorDate: Wed Apr 3 09:55:25 2019 +0800
Fix flaky test poisson generator & test_negative_binomial_generator (#14571)
* set success_rate to 0.2
* fix the flaky test
* reenable the test
---
python/mxnet/test_utils.py | 2 +-
tests/python/unittest/test_random.py | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/python/mxnet/test_utils.py b/python/mxnet/test_utils.py
index 6d1749b..bbb12dd 100644
--- a/python/mxnet/test_utils.py
+++ b/python/mxnet/test_utils.py
@@ -1926,7 +1926,7 @@ def chi_square_check(generator, buckets, probs, nsamples=1000000):
_, p = ss.chisquare(f_obs=obs_freq, f_exp=expected_freq)
return p, obs_freq, expected_freq
-def verify_generator(generator, buckets, probs, nsamples=1000000, nrepeat=5, success_rate=0.25, alpha=0.05):
+def verify_generator(generator, buckets, probs, nsamples=1000000, nrepeat=5, success_rate=0.2, alpha=0.05):
"""Verify whether the generator is correct using chi-square testing.
The test is repeated for "nrepeat" times and we check if the success rate is
diff --git a/tests/python/unittest/test_random.py b/tests/python/unittest/test_random.py
index c3eebcf..8fbd97d 100644
--- a/tests/python/unittest/test_random.py
+++ b/tests/python/unittest/test_random.py
@@ -568,7 +568,6 @@ def test_exponential_generator():
for _ in range(10)])
verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs, success_rate=0.20)
-@unittest.skip("Flaky test. Tracked in https://github.com/apache/incubator-mxnet/issues/13584")
@with_seed()
def test_poisson_generator():
ctx = mx.context.current_context()
@@ -584,7 +583,6 @@ def test_poisson_generator():
for _ in range(10)])
verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs)
-@unittest.skip("Flaky test. Tracked in https://github.com/apache/incubator-mxnet/issues/13506")
@with_seed()
def test_negative_binomial_generator():
ctx = mx.context.current_context()