TST: add unit test
This commit is contained in:
parent
b1ea047fc4
commit
8ae27c004c
@ -390,6 +390,22 @@ class LeakyReluTest(test.TestCase):
|
||||
self.evaluate(optimizer.minimize(loss))
|
||||
self.assertAllClose(x.read_value(), -99.9)
|
||||
|
||||
def testUnexpectedAlphaValue(self):
|
||||
self.assertAllClose(
|
||||
np.array([[-9.0, 0.7, -5.0, 0.3, -0.1],
|
||||
[0.1, -3.0, 0.5, -27.0, 0.9]]),
|
||||
nn_ops.leaky_relu(
|
||||
np.array([[-0.9, 0.7, -0.5, 0.3, -0.01],
|
||||
[0.1, -0.3, 0.5, -2.7, 0.9]]),
|
||||
alpha=10))
|
||||
self.assertAllClose(
|
||||
np.array([[9.0, 0.7, 5.0, 0.3, 0.1],
|
||||
[0.1, 3.0, 0.5, 27.0, 0.9]]),
|
||||
nn_ops.leaky_relu(
|
||||
np.array([[-0.9, 0.7, -0.5, 0.3, -0.01],
|
||||
[0.1, -0.3, 0.5, -2.7, 0.9]]),
|
||||
alpha=-10))
|
||||
|
||||
|
||||
class EluTest(test.TestCase):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user