python-keras build fails: test_selu: Not equal to tolerance rtol=1e-07, atol=0

  • Done
  • quality assurance status badge
Details
3 participants
  • Gábor Boskovits
  • Pierre Neidhardt
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Pierre Neidhardt
Severity
normal
P
P
Pierre Neidhardt wrote on 11 Feb 2020 11:49
(address . bug-guix@gnu.org)
87blq51jqu.fsf@ambrevar.xyz
Tests fail with:

Toggle snippet (31 lines)
=================================== FAILURES ===================================
__________________________________ test_selu ___________________________________

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)
E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=0
E
E Mismatch: 50%
E Max absolute difference: 1.1920929e-07
E Max relative difference: 1.0726715e-07
E x: array([[-1.111331, -1.520167]], dtype=float32)
E y: array([[-1.111331, -1.520167]], dtype=float32)

tests/keras/activations_test.py:226: AssertionError

See attached log.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5ChskACgkQm9z0l6S7
zH848Af+OVXTI+ZqQZ7EdyWHWoNvmE/Rgfknl52NhLCJiOZru01VlNearu+WhiQs
98PP7CEUAHVGyyEp3sSuyJ2NMtgTzfhh7utHCDVVrrTJ8Ib4AnktwTIqekQWNL+I
qOutSLLlFPSRWh8uhshArK9It6/VfVcjqKqyw8WsdN6e6U1IJqgXkCV5a+qj3xTi
ESyUMOC0DsC905vfAyXhvWZhocqYsoeEyFGrs5+yMYjKGbPgo41SpJ/rB2ip1ETh
vpL7JNkqOslCeUu2ZdVYgUxPSa7o2bn8lpntQdZ7a3sp2MgXvnWxMiD+uz6p55O2
U1199+SBZbf0ZHBzJK0Ctqxp7Ks4PA==
=gPSR
-----END PGP SIGNATURE-----

Attachment: keras-build.log
G
G
Gábor Boskovits wrote on 11 Feb 2020 20:25
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 39562@debbugs.gnu.org)
CAE4v=pjUSXaO+u6HpSEKOTyDK5L2oyX0u3j+=5sbmxeU4dF6-A@mail.gmail.com
This resembles to the babl issue we are having. Is it possible that this is
hardware related?

Pierre Neidhardt <mail@ambrevar.xyz> ezt írta (id?pont: 2020. febr. 11., Ke
16:19):

Toggle quote (42 lines)
> Tests fail with:
>
> --8<---------------cut here---------------start------------->8---
> =================================== FAILURES
> ===================================
> __________________________________ test_selu
> ___________________________________
>
> 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)
> E AssertionError:
> E Not equal to tolerance rtol=1e-07, atol=0
> E
> E Mismatch: 50%
> E Max absolute difference: 1.1920929e-07
> E Max relative difference: 1.0726715e-07
> E x: array([[-1.111331, -1.520167]], dtype=float32)
> E y: array([[-1.111331, -1.520167]], dtype=float32)
>
> tests/keras/activations_test.py:226: AssertionError
> --8<---------------cut here---------------end--------------->8---
>
> See attached log.
>
> --
> Pierre Neidhardt
> https://ambrevar.xyz/
>
Attachment: file
P
P
Pierre Neidhardt wrote on 3 Mar 2020 10:24
(name . Gábor Boskovits)(address . boskovits@gmail.com)(address . 39562@debbugs.gnu.org)
87zhcx23m7.fsf@ambrevar.xyz
Patch sent: 39880@debbugs.gnu.org.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl5eIjAACgkQm9z0l6S7
zH/BkAf/VQLVTuvEjqeEz4rjoCLjwQ9BaJjlGVF8H3ygb88NoRGyzEYq8g4mfPGH
UZc0IoCh60XnZ9t4xkulzJQeoOvY6fg5PTahGJ0BM7zYyxixcli5xvHeKrvqY96e
KHtetvoOaZUVVwrCV2jmm4kasvSePch4jvqavn7FHDiGxRuu1/uw5ce6KS871NF+
yZRaRAqRBSI8tXt3fxb0mBTsWlMRKs6+bj5VtFTZ7ry0avK0CQrC3GXGc9dDXc0k
5tFEoGiW7Q3fNZqqAQ3OE4sA4qgpQ1eFlVHYYv/s67zajBL2r1Lo5kGH9rvcmmN5
GQRpQ62C02IujUBkdAzHM2OZ6tFs/A==
=B9uB
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 5 Oct 2020 07:52
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87imbpjk2l.fsf@gmail.com
Pierre Neidhardt <mail@ambrevar.xyz> writes:

Toggle quote (3 lines)
> Patch sent: 39880@debbugs.gnu.org.
> Also see https://github.com/keras-team/keras/issues/13856.

I fixed it with a substitute* instead, and also applied another upstream
fix in commit 5f37d7e38e.

Thanks for the report!

Closing,

Maxim
Closed
P
P
Pierre Neidhardt wrote on 5 Oct 2020 10:31
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
878sclkr9n.fsf@ambrevar.xyz
Thanks!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl962fQSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/4XoH/2QbRdDVAdvyGZSW0B59DEV0TKt1gNKJ
IKMCbpq9u+o4VuxZBk0BFduyzmPQJYXH95OGnMlhYYdxcxo0PVVu8pOtA4dmQfq0
jkF1aDL20xjdpV2gdu9+tmSg9aDV2DSjZYcSsnGjhj7QytRatHtjhUm8IZRfhZNu
Ztg3KcCl3ma1Gs/fXQL3zRCzxLdofhgavoxJCaj8z2rkB8tHhb9ivs7eP1Rr8uCX
WhRfaYidhExAnlJH6DZFJMCMv46+OhxuRtYETSlhgcAJ3o8X1k7dnuwnlQVpj/FE
b96e/ypSAZQnhIf0/w7s1ZKMnU8MxUfGxlTU/hAxnuf222uyIg/d+28=
=cTqj
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 39562@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39562
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch