Weights wi: Learning means adjusting these. High weight = "this input matters a lot."
Bias b: Without it, output is zero when all inputs are zero. Bias lets the neuron activate even with no input—think of it as the neuron's "resting potential."
Activation f: Converts the linear combo into a non-linear output. This is crucial—multiple linear functions compose to just another linear function, which can't learn XOR or any complex pattern.
WHEN to use: Hidden layers when you want zero-centered activations (helps with convergence), or outputs representing signed quantities (e.g., control surface deflection: -1 = full down, +1 = full up).
Hidden layers (better than sigmoid), signed outputs
Recall Explain to a 12-Year-Old
Imagine you're building a robot pilot. It needs to decide: "Should I pull the control stick up or push it down?"
The robot's brain is made of tiny decision-makers called neurons. Each neuron looks at sensor readings (airspeed, altitude), multiplies each by a number called a weight (like saying "airspeed is 3× more important than altitude"), adds them up, then adds a bias (a starting nudge).
But here's the trick: if we just add and multiply, the robot can only learn straight-line rules. Real flying is curvy and complex! So we use an activation function—a magic math rule that bends the straight line into curves.
ReLU is like a door: negative numbers become zero (door closed), positive numbers stay (door open). Fast and simple.
Sigmoid squishes everything between 0 and 1, like a confidence meter: "I'm 90% sure this is an emergency."
Tanh squishes between -1 and +1, perfect for "push stick forward (-1) or pull back (+1)."
Without these bending functions, the robot brain would be dumb—just fancy addition. With them, it learns to fly through storms, dodge obstacles, anything!
What are the three components of an artificial neuron's computation? :: Weighted sum of inputs (∑wixi), bias (b), and activation function (f).
Why do neural networks need activation functions?
Without non-linearity, stacking layers colapses to a single linear transformation (y=Ax+b), incapable of learning complex patterns like XOR or curved decision boundaries.
What is the formula for ReLU?
f(z)=max(0,z). Output is z if positive, 0 if negative.
What is the derivative of ReLU?
f′(z)=1 if z>0, else 0. (Undefined at z=0, but treated as 0 or 1 in practice.)
What problem does ReLU solve compared to sigmoid?
Vanishing gradient problem. ReLU's gradient is 1 for positive inputs, preventing gradient shrinkage in deep networks.
What is the sigmoid function formula?
σ(z)=1+e−z1.
What is the range of sigmoid?
(0,1)—naturally interprets as probability.
Derive the derivative of sigmoid.
σ′(z)=σ(z)(1−σ(z)). Proof: apply chain rule to 1+e−z1, factor into σ(z)⋅(1−σ(z)).
What is the tanh function formula?
tanh(z)=ez+e−zez−e−z or equivalently 2σ(2z)−1.
What is the range of tanh?
(−1,1)—zero-centered, useful for signed outputs.
What is the derivative of tanh? :: tanh′(z)=1−tanh2(z).
When should you use ReLU?
Default for hidden layers in deep networks (fast, avoids vanishing gradient).
When should you use sigmoid?
Binary classification output layer where you need probabilities in [0,1].
When should you use tanh?
Hidden layers for zero-centered activations, or outputs representing signed quantities (e.g., control deflections).
What is the "dead ReLU" problem?
A neuron's weighted sum is always negative, so output is always 0. Gradient is 0, weights never update—neuron is permanently inactive.
How do you fix dead ReLU neurons?
Use Leaky ReLU (f(z)=max(0.01z,z)), proper weight initialization (He), or lower learning rate.
Why is sigmoid bad for hidden layers in deep networks?
Vanishing gradient: σ′(z)≤0.25, so gradients multiply to near-zero across many layers, stopping learning.
What is the role of bias b in a neuron?
Shifts the activation threshold, allowing the neuron to activate even when inputs are zero.
How does ReLU introduce non-linearity if it looks linear for z>0?
The "kink" at z=0 is the non-linearity. The function is not differentiable everywhere, breaking the linear composition property.
Neural network ki basic building block hai neuron. Isko samjho biological brain cell ki tarah—inputs lete hai, unhe weights se multiply karte hai (importance decide karne ke liye), sab add karte hai, fir ek bias add karte hai (baseline adjustment), aur finally ek activation function se pass karte hai jo non-linearity lata hai. Ye non-linearity bahut zaroori hai, warna kitne bhi layers stack karo, bas ek fancy linear equation banega—complex patterns nahi seekh payega.
Aerospace mein neural networks ka use hota hai flight control, trajectory prediction, sensor fusion, aur anomaly detection mein. Teen main activation functions hain: ReLU (Rectified Linear Unit), jo negative values ko zero kar deta hai aur positive ko waise hi chodta hai—fast aur vanishing gradient problem solve karta hai, isliye deep networks mein default choice hai. Sigmoid output ko 0 se 1 ke bech squash karta hai, perfect for binary classification (jaise "sensor faulty hai ya nahi?"). Tanh -1 se +1 range deta hai, zero-centered, acha for control outputs jahan positive aur negative dono directions chahiye (jaise elevator up/down deflection).
Common mistake: sigmoid ko hidden layers mein use karna deep networks mein—gradient vanish ho jata hai because sigmoid ka derivative maximum 0.25 hai, toh 10 layers mein multiply karo toh gradient practically zero ho jaata hai. ReLU iska solution hai kyunki uska gradient 1 hai active neurons ke liye.Ek aur problem hai dead ReLU: agar neuron ka weighted sum hamesha negative ho, toh output hamesha 0, gradient0, weights kabhi update nahi—neuron permanently inactive. Fix: Leaky ReLU use karo ya proper initialization (He initialization) karo.
Activation functions neural networks ko power dete hain complex, non-linear patterns seekhne ki—jaise curved flight envelopes, image features, ya XOR logic gates. Bina inke, network sirf straight lines draw kar sakta hai, aur real-world problems rarely linear hote hain!