From: François Fleuret Date: Mon, 15 May 2023 05:21:20 +0000 (+0200) Subject: Update X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=c7475c52af263fbfe367797682979525532e4d7e;p=pytorch.git Update --- diff --git a/rmax.py b/rmax.py index 291ce92..b51a5bf 100755 --- a/rmax.py +++ b/rmax.py @@ -31,10 +31,16 @@ def rmax_back(y): ################################################## -x = torch.randn(3, 14) +# x = torch.randn(3, 14) + +# Checking that ambiguous max does not hurt +x = torch.randint(21, (100, 50)) - 10 + y = rmax(x) -print(f"{x.size()=} {x.max(-1).values=}") -print(f"{y.size()=} {y[:,-1]=}") + +print(f"{x.size()=} {y.size()=}") +print(f"{(x.max(-1).values - y[:,-1]).abs().max()=}") z = rmax_back(y) + print(f"{(z-x).abs().max()=}")