Activation Functions in Neural Networks — AI Technical Interview Questions & Answers

Activation Functions in Neural Networks

Activation Functions in Neural Networks

  • Activation adds non-linearity. Without it, stacked layers collapse to one linear map. ReLU = max(0, x) is the workhorse. Sigmoid/tanh squash; they saturate (vanishing gradients). Softmax on the last layer for multi-class probabilities.
  • Viva: why activation + name ReLU + one old one (sigmoid).
  • Activation Functions in Neural Networks — output: -2 → 0 / 0 → 0 / 3 → 3. Without activation, deep layers collapse to linear.

Technical Interview Tip: Why no activation = pointless deep net.

Code Examples for Activation Functions in Neural Networks

Example

# ReLU
def relu(x):
    return x if x > 0 else 0
for v in [-2, 0, 3]:
    print(v, "→", relu(v))

Activation Functions in Neural Networks — output: -2 → 0 / 0 → 0 / 3 → 3. Without activation, deep layers collapse to linear.

How to Explain Activation Functions in Neural Networks to an Interviewer

Explain Activation Functions in Neural Networks as if you are teaching a junior — definition, then one example.

Non-linearity. ReLU common. Softmax for classes.

What does the example print, and what does that prove?

Activation Functions in Neural Networks — output: -2 → 0 / 0 → 0 / 3 → 3

What mistake do freshers make with Activation Functions in Neural Networks?

Only the buzzword, no example