Skip to content

Commit

Permalink
Fix flaky negative sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
hvy committed Aug 20, 2019
1 parent 2e3ed4a commit 940bf36
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
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 940bf36

Please sign in to comment.