summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-keras-selu-test.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/python-keras-selu-test.patch')
-rw-r--r--gnu/packages/patches/python-keras-selu-test.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-keras-selu-test.patch b/gnu/packages/patches/python-keras-selu-test.patch
new file mode 100644
index 0000000000..68092d2593
--- /dev/null
+++ b/gnu/packages/patches/python-keras-selu-test.patch
@@ -0,0 +1,35 @@
+Disable unstable SELU test.
+See https://github.com/keras-team/keras/issues/13856.
+
+diff --git a/tests/keras/activations_test.py b/tests/keras/activations_test.py
+index 4c0bb36..5808c0f 100644
+--- a/tests/keras/activations_test.py
++++ b/tests/keras/activations_test.py
+@@ -208,24 +208,6 @@ def test_elu():
+ assert_allclose(result, true_result)
+
+
+-def test_selu():
+- x = K.placeholder(ndim=2)
+- f = K.function([x], [activations.selu(x)])
+- alpha = 1.6732632423543772848170429916717
+- scale = 1.0507009873554804934193349852946
+-
+- positive_values = get_standard_values()
+- result = f([positive_values])[0]
+- assert_allclose(result, positive_values * scale, rtol=1e-05)
+-
+- negative_values = np.array([[-1, -2]], dtype=K.floatx())
+-
+- result = f([negative_values])[0]
+- true_result = (np.exp(negative_values) - 1) * scale * alpha
+-
+- assert_allclose(result, true_result)
+-
+-
+ def test_tanh():
+ test_values = get_standard_values()
+
+--
+2.25.1
+