Activation Functions interview question

Deep LearningActivation Functionsbasic

What is the ReLU activation, and why is it a popular default for hidden layers?

  1. AReLU(x) = 1 / (1 + e⁻ˣ); it squashes outputs into (0, 1), which makes hidden activations read as probabilities.
  2. BReLU(x) = max(0.01x, x); its small negative slope removes dead neurons, which is the main reason it became the default.
  3. CReLU(x) = x for every input; keeping each layer linear preserves gradients exactly and so speeds up training.
  4. DReLU(x) = max(0, x); it is cheap to compute and has gradient 1 for positive inputs, which eases vanishing gradients.
Show the answer and explanation

Correct answer: D, ReLU(x) = max(0, x); it is cheap to compute and has gradient 1 for positive inputs, which eases vanishing gradients.

Explanation Activation Functions

The rectified linear unit is ReLU(x) = max(0, x): it passes positive inputs unchanged and outputs 0 for negative ones. Its benefits: it is very cheap (a comparison), it does not saturate for positive inputs (gradient exactly 1 there, so gradients pass through many layers without shrinking), and it produces sparse activations because many units output 0.

Why the other definitions are wrong:

  • 1 / (1 + e⁻ˣ) is the sigmoid.
  • max(0.01x, x) is Leaky ReLU, a variant designed to fix dying ReLU.
  • The identity x is a linear activation; stacking linear layers collapses into one linear map, so the network could not learn non-linear functions.

The main weakness of ReLU is the dying ReLU problem: units stuck in the negative region receive zero gradient.

Interview tip: give the formula, then "no saturation for x > 0, cheap, sparse"; expect the follow-up "what is dying ReLU and how do you fix it?"

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Deep Learning questions

  1. In neural network training, what is backpropagation?
  2. What does dropout do while a neural network is being trained?
  3. What does a 2-D convolutional layer compute at each output position?
  4. In a vanilla recurrent neural network, what is the hidden state?
  5. What is the core idea of an attention mechanism in a neural network?