11

Does anyone know the default activation function used in the recurrent layers in Keras? https://keras.io/layers/recurrent/

It says the default activation function is linear. But what about the default recurrent activation function. Nothing is mentioned about that. Any help would be highly appreciated. Thanks in advance

1

2 Answers 2

7

Keras Recurrent is an abstact class for recurrent layers. In Keras 2.0 all default activations are linear for all implemented RNNs (LSTM, GRU and SimpleRNN). In previous versions you had:

  • linear for SimpleRNN,
  • tanh for LSTM and GRU.
1
  • 1
    Seems this answer is outdated. In Keras 2.2.4 default activation for LSTM is tanh Apr 16, 2019 at 8:25
1

https://github.com/keras-team/keras/blob/master/keras/layers/recurrent.py#L2081

It mentions tanh here for version 2.3.0 :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.