Skip to content

Commit

Permalink
Merge pull request #7975 from hvy/flaky-negative-sampling
Browse files Browse the repository at this point in the history
Fix flaky `negative_sampling`
  • Loading branch information
mergify[bot] committed Aug 22, 2019
2 parents 51c0014 + 940bf36 commit 6ee8337
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -68,13 +68,17 @@ def setUp(self):
self.ggw = numpy.random.uniform(-1, 1, w_shape).astype(self.dtype)

self.check_forward_options = {}
self.check_backward_options = {'eps': 1e-2, 'atol': 5e-4, 'rtol': 5e-3}
self.check_backward_options = {
'eps': 1e-2, 'atol': 5e-4, 'rtol': 5e-3}
self.check_double_backward_options = {
'eps': 1e-2, 'atol': 1e-3, 'rtol': 1e-2}
if self.dtype == numpy.float16:
self.check_forward_options = {'atol': 1e-3, 'rtol': 1e-3}
self.check_backward_options['dtype'] = numpy.float64
self.check_double_backward_options['dtype'] = numpy.float64
self.check_forward_options.update(
{'atol': 1e-3, 'rtol': 1e-3})
self.check_backward_options.update(
{'rtol': 5e-2, 'dtype': numpy.float64})
self.check_double_backward_options.update(
{'dtype': numpy.float64})

def test_forward(self, backend_config):
sampler = make_sampler(backend_config, self.label_size)
Expand Down

0 comments on commit 6ee8337

Please sign in to comment.