How can we define different activation functions for different components? #3287
Unanswered
blackblitz
asked this question in
Q&A
Replies: 1 comment
-
Use jnp.stack. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to define different activation functions for different components. For example, I have two nodes in a layer and would like to have identity activation for the first node and square activation for the second node. The following is my attempt.
This works fine if I call
model.apply
on a one-dimensionalx
, but if I perform batch apply with two-dimensionalx
, it does not give the correct shape. For example, if I inputx
with shape(100, 1)
, it should outputy
with shape(100, 2)
, but the output actually has shape(2, 2)
. How should I properly define the activation functions?Beta Was this translation helpful? Give feedback.
All reactions