EasyDeepLearn

ReLU vs sigmoid vs GELU — when do you use each?

easy

Answer

  • Sigmoid/tanh saturate and cause vanishing gradients — avoid in hidden layers of deep nets, keep sigmoid for a binary output.
  • ReLU is the default hidden activation: fast, sparse, but suffers from 'dying ReLU' (permanently zero neurons).
  • Leaky ReLU / ELU fix that.
  • GELU is a smooth approximation of ReLU and is the standard in transformers (BERT, GPT).
  • SiLU/Swish is also popular in modern vision and LLMs.
Check yourself — multiple choice
  • Sigmoid is the best hidden-layer activation for deep nets
  • GELU is standard in transformer architectures
  • ReLU never has a 'dying' problem
  • Tanh does not saturate

Transformers (BERT, GPT) use GELU or a similar smooth activation.

#activations#fundamentals

Practise Deep Learning

214 interview questions in this topic.

Related questions