Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Counting in binary is just like counting in decimal -- if you are all thumbs. -- Glaser and Way


devel / comp.lang.python / Re: question on trax

SubjectAuthor
o Re: question on traxDennis Lee Bieber

1
Re: question on trax

<mailman.429.1629309989.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=14661&group=comp.lang.python#14661

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: question on trax
Date: Wed, 18 Aug 2021 12:42:59 -0400
Organization: IISS Elusive Unicorn
Lines: 43
Message-ID: <mailman.429.1629309989.4164.python-list@python.org>
References: <CAN_spzhmYQ+sVXrjRM6pgUmOYTe0LBM_QuA2ecVF4LNww2eniw@mail.gmail.com>
<rbdqhg533aaac62lo9kcp5lu768cqlgb0c@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de sgwmtaY46GbONLcRBUMuRAdsBJJ0kZgOJLco24g4xRNA==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'def': 0.04; 'joseph': 0.05; 'explicitly': 0.07; 'modules': 0.07;
'"""': 0.09; 'aug': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'skip:` 10':
0.09; 'url-ip:140/8': 0.12; 'url:github': 0.13; 'import': 0.14;
'+0200,': 0.16; '748': 0.16; 'applies': 0.16; 'args:': 0.16;
'arguments': 0.16; 'lambda': 0.16; 'message-id:@4ax.com': 0.16;
'outputs': 0.16; 'pareti': 0.16; 'received:116.202': 0.16;
'received:116.202.254': 0.16; 'received:116.202.254.214': 0.16;
'url:master': 0.16; 'weights': 0.16; 'xxx': 0.16;
'subject:question': 0.18; 'tue,': 0.18; 'uses': 0.19; 'returns':
0.23; 'to:addr:python-list': 0.23; 'function': 0.28; 'default':
0.28; 'module': 0.28; 'output': 0.28; 'input': 0.29; 'header:User-
Agent:1': 0.31; 'header:Organization:1': 0.31; 'code,': 0.31;
'takes': 0.31; 'but': 0.31; 'keyword': 0.32; 'specified': 0.32;
'using': 0.33; 'class': 0.33; 'same': 0.34; 'example,': 0.35;
'following': 0.35; 'level.': 0.35; 'two': 0.37; "it's": 0.38;
'use': 0.38; 'does': 0.38; 'put': 0.39; 'resulting': 0.68;
'order': 0.68; 'received:116': 0.71; '2021': 0.84; '-->': 0.84;
'executing': 0.84; 'i.e': 0.84; 'imports': 0.84; 'inputs': 0.84;
'promised': 0.84; 'url-ip:76/8': 0.84; 'url:blob': 0.84; 'sub':
0.91
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: ForteAgent/8.00.32.1272
X-Mailman-Approved-At: Wed, 18 Aug 2021 14:06:28 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <rbdqhg533aaac62lo9kcp5lu768cqlgb0c@4ax.com>
X-Mailman-Original-References: <CAN_spzhmYQ+sVXrjRM6pgUmOYTe0LBM_QuA2ecVF4LNww2eniw@mail.gmail.com>
 by: Dennis Lee Bieber - Wed, 18 Aug 2021 16:42 UTC

On Tue, 17 Aug 2021 17:50:59 +0200, joseph pareti <joepareti54@gmail.com>
declaimed the following:

>In the following code, where does tl.Fn come from? i see it nowhere in the
>documents, i.e I was looking for trax.layers.Fn :

"layers" imports a whole slew of sub modules using
from xxx import *
in order to put all the sub module names at the same level.

https://github.com/google/trax/blob/master/trax/layers/base.py
>From line 748 on...

def Fn(name, f, n_out=1): # pylint: disable=invalid-name
"""Returns a layer with no weights that applies the function `f`.
`f` can take and return any number of arguments, and takes only
positional
arguments -- no default or keyword arguments. It often uses JAX-numpy
(`jnp`).
The following, for example, would create a layer that takes two inputs
and
returns two outputs -- element-wise sums and maxima:
`Fn('SumAndMax', lambda x0, x1: (x0 + x1, jnp.maximum(x0, x1)),
n_out=2)`
The layer's number of inputs (`n_in`) is automatically set to number of
positional arguments in `f`, but you must explicitly set the number of
outputs (`n_out`) whenever it's not the default value 1.
Args:
name: Class-like name for the resulting layer; for use in debugging.
f: Pure function from input tensors to output tensors, where each input
tensor is a separate positional arg, e.g., `f(x0, x1) --> x0 + x1`.
Output tensors must be packaged as specified in the `Layer` class
docstring.
n_out: Number of outputs promised by the layer; default value 1.
Returns:
Layer executing the function `f`.
"""

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor