1427bfc12ec5a3a2c6a4ffd57fc5b465d3eedfae,tensorflow/python/kernel_tests/relu_op_test.py,ReluTest,testGradientFloat16,#ReluTest#,124

Before Change



    // Repeat the experiment for 100 times. All tensor shapes and its tensor
    // values are randomly generated for each run.
    for _ in xrange(100):
      d32, d16 = f()
      self.assertAllClose(d32, d16, atol=3e-4)

  def testGradientFloat64(self):
    with self.cached_session():
      x = np.asarray(
          [[-0.9, -0.7, -0.5, -0.3, -0.1], [0.1, 0.3, 0.5, 0.7, 0.9]],

After Change


  // defined at around zero and we want to avoid that in terms of input values.
  def testGradientFloat16(self):
    with self.cached_session():
      x = np.asarray(
          [[-0.9, -0.7, -0.5, -0.3, -0.1], [0.1, 0.3, 0.5, 0.7, 0.9]],
          dtype=np.float16,
          order="F")
      err = gradient_checker_v2.max_error(
          *gradient_checker_v2.compute_gradient(nn_ops.relu, [x]))
    self.assertLess(err, 1e-6)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/tensorflow
Commit Name: 1427bfc12ec5a3a2c6a4ffd57fc5b465d3eedfae
Time: 2020-11-19
Author: gardener@tensorflow.org
File Name: tensorflow/python/kernel_tests/relu_op_test.py
Class Name: ReluTest
Method Name: testGradientFloat16


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 906ba34449e0f19b7f3b674d5e005a1903d0642e
Time: 2017-11-10
Author: carloderamo@gmail.com
File Name: examples/mountain_car.py
Class Name:
Method Name: experiment


Project Name: tensorflow/tensorflow
Commit Name: e818c9e626fc5c95516e68fb2282f07d0232eea9
Time: 2020-11-18
Author: gardener@tensorflow.org
File Name: tensorflow/python/kernel_tests/relu_op_test.py
Class Name: ReluTest
Method Name: testGradientFloat16


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 906ba34449e0f19b7f3b674d5e005a1903d0642e
Time: 2017-11-10
Author: carloderamo@gmail.com
File Name: tests/mountain_car/mountain_car.py
Class Name:
Method Name: experiment