From patchwork Tue Mar 3 10:38:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 20503 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DABD427BBEA; Tue, 3 Mar 2020 10:39:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 57F9927BBE4 for ; Tue, 3 Mar 2020 10:39:11 +0000 (GMT) Received: from localhost ([::1]:45150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j94xC-0007KE-Tp for patchwork@mira.cbaines.net; Tue, 03 Mar 2020 05:39:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57726) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j94x6-0007IH-13 for guix-patches@gnu.org; Tue, 03 Mar 2020 05:39:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j94x3-0000QW-Ns for guix-patches@gnu.org; Tue, 03 Mar 2020 05:39:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j94x3-0000QQ-KM for guix-patches@gnu.org; Tue, 03 Mar 2020 05:39:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j94x3-00072C-Is for guix-patches@gnu.org; Tue, 03 Mar 2020 05:39:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39880] [PATCHv2] gnu: python-keras: Fix tests. References: <20200303092201.7174-1-mail@ambrevar.xyz> In-Reply-To: <20200303092201.7174-1-mail@ambrevar.xyz> Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Mar 2020 10:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39880 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39880@debbugs.gnu.org Received: via spool by 39880-submit@debbugs.gnu.org id=B39880.158323190226977 (code B ref 39880); Tue, 03 Mar 2020 10:39:01 +0000 Received: (at 39880) by debbugs.gnu.org; 3 Mar 2020 10:38:22 +0000 Received: from localhost ([127.0.0.1]:38730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j94wP-000713-PM for submit@debbugs.gnu.org; Tue, 03 Mar 2020 05:38:22 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:52461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j94wL-00070m-7X for 39880@debbugs.gnu.org; Tue, 03 Mar 2020 05:38:20 -0500 X-Originating-IP: 92.169.129.147 Received: from bababa.home (lfbn-idf2-1-1315-147.w92-169.abo.wanadoo.fr [92.169.129.147]) (Authenticated sender: mail@ambrevar.xyz) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 31B1FE000F for <39880@debbugs.gnu.org>; Tue, 3 Mar 2020 10:38:09 +0000 (UTC) From: Pierre Neidhardt Date: Tue, 3 Mar 2020 11:38:09 +0100 Message-Id: <20200303103809.18233-1-mail@ambrevar.xyz> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 +