GNU bug report logs -
#39880
[PATCH] gnu: python-keras: Fix tests.
Previous Next
Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>
Date: Tue, 3 Mar 2020 09:23:02 UTC
Severity: normal
Tags: fixed, patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39880 in the body.
You can then email your comments to 39880 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 09:23:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Pierre Neidhardt <mail <at> ambrevar.xyz>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Tue, 03 Mar 2020 09:23:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/machine-learning.scm (python-keras)[origin]: Add patch to
remove unstable selu test.
* gnu/local.mk: Include patch.
---
gnu/local.mk | 1 +
gnu/packages/machine-learning.scm | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 857345cfad..e5922aae54 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1329,6 +1329,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-configobj-setuptools.patch \
%D%/packages/patches/python-faker-fix-build-32bit.patch \
%D%/packages/patches/python-keras-integration-test.patch \
+ %D%/packages/patches/python-keras-selu-test.patch \
%D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
%D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
%D%/packages/patches/python-flint-includes.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8262a418cc..7fbdef0163 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1863,7 +1863,9 @@ with image data, text data, and sequence data.")
(origin
(method url-fetch)
(uri (pypi-uri "Keras" version))
- (patches (search-patches "python-keras-integration-test.patch"))
+ (patches
+ (search-patches "python-keras-selu-test.patch" ; Numerically unstable?
+ "python-keras-integration-test.patch"))
(sha256
(base32
"1j8bsqzh49vjdxy6l1k4iwax5vpjzniynyd041xjavdzvfii1dlh"))))
--
2.25.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 10:18:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 39880 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
You forgot to add the patch :P
--
Efraim Flashner <efraim <at> flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 10:39:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 39880 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/machine-learning.scm (python-keras)[origin]: Add patch to
remove unstable selu test.
* gnu/local.mk: Include patch.
* gnu/packages/patches/python-keras-selu-test.patch: New file.
---
gnu/local.mk | 1 +
gnu/packages/machine-learning.scm | 4 ++-
.../patches/python-keras-selu-test.patch | 35 +++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/python-keras-selu-test.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 857345cfad..e5922aae54 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1329,6 +1329,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-configobj-setuptools.patch \
%D%/packages/patches/python-faker-fix-build-32bit.patch \
%D%/packages/patches/python-keras-integration-test.patch \
+ %D%/packages/patches/python-keras-selu-test.patch \
%D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
%D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
%D%/packages/patches/python-flint-includes.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8262a418cc..7fbdef0163 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1863,7 +1863,9 @@ with image data, text data, and sequence data.")
(origin
(method url-fetch)
(uri (pypi-uri "Keras" version))
- (patches (search-patches "python-keras-integration-test.patch"))
+ (patches
+ (search-patches "python-keras-selu-test.patch" ; Numerically unstable?
+ "python-keras-integration-test.patch"))
(sha256
(base32
"1j8bsqzh49vjdxy6l1k4iwax5vpjzniynyd041xjavdzvfii1dlh"))))
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
+
--
2.25.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 10:39:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 39880 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Oops! Resent.
--
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 11:46:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 39880 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I assume you've already gone for the more obvious and seen if you can
upgrade keras to 2.3.1?
--
Efraim Flashner <efraim <at> flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#39880
; Package
guix-patches
.
(Tue, 03 Mar 2020 11:57:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 39880 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Indeed :)
Starting from Keras 2.2.5, the other backends are unconditionally
required by the tests, so it won't do :(
Not sure what to do about it. In all cases, it's a a lot of work, so I
figured we'd rather get 2.2.4 to build at least.
--
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]
Added tag(s) fixed.
Request was from
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 05 Oct 2020 05:54:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
39880 <at> debbugs.gnu.org and Pierre Neidhardt <mail <at> ambrevar.xyz>
Request was from
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 05 Oct 2020 05:54:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 02 Nov 2020 12:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 175 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.