-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional layer API, conventions #21
Comments
We can also have both, i.e. a This might be more natural for things like |
This is basically done now. We have both when it makes sense ( |
Ok, now I start to question again whether it makes sense to have both The question is, do we want to have that for every function? When there is a function Isn't that a bit annoying, that you would always need to write both? Or do we want to have it mixed? In some cases, we have both versions, in others, only the function? |
Btw, for Example:
Or maybe not. Maybe it is just fine to do:
|
I think we can leave it as it is now, i.e. only the function. In case the function has further option arguments (
|
Definition: Functional means that the layer / op does not have trainable parameters.
Examples:
tanh
,sigmoid
etc, i.e. all math ops. RETURNN:ActivationLayer
dot
/matmul
/einsum
. RETURNN:DotLayer
split
. RETURNN:SplitLayer
Instead of writing
Activation(activation="tanh")(x)
, one should be able to write simplytanh(x)
.Instead of
Dot(...)(x, y)
, one should be able to writedot(x, y, ...)
or so. (Or maybe using a more einsum-like API.)Instead of
Split(...)(x)
,split(x, ...)
.Similar as in the PyTorch functional API.
The naming convention would be to start with lowercase letter, unlike modules which start with upper case.
Also, modules are classes, and need to be initiated. The functional API would just behave like functions.
Related are also the elemwise ops on a
LayerRef
, such as+
,==
etc.Some open questions:
einsum
/dot
. Alsotanh
etc need to be explicit.Sigmoid
as a module, andsigmoid
as a function?The text was updated successfully, but these errors were encountered: