Activation Functions & Non Linearity Questions
Know common activation functions: ReLU, sigmoid, tanh, softmax, GELU, and Swish. Understand why non-linearity is necessary: stacking any number of purely linear layers collapses to a single linear transformation, eliminating the network's ability to model complex functions. Know the advantages and disadvantages of each activation function (vanishing gradients, dead neurons/dying ReLU, computational cost, output range, saturation). Understand why ReLU remains the default choice in modern architectures despite its simplicity, and when smoother alternatives (GELU, Swish) are preferred in transformer-style models.
Sample Answer
Sample Answer
Sample Answer
Sample Answer
# PyTorch good
loss = F.cross_entropy(logits, targets) # fused, stable
# if custom needed
log_probs = F.log_softmax(logits, dim=1)
loss = F.nll_loss(log_probs, targets)Sample Answer
Unlock Full Question Bank
Get access to hundreds of Activation Functions & Non Linearity interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.