42. Activation Functions, Loss, and Gradient Descent (Plain English)
42.1 Activation Functions Simply
42.1 Activation functions — simple
Activation नसेल तर layers एक मोठी linear formula होतात. Bends हवेत.
हे का शिकायचं?
Why. Activation नसेल तर stacked layers एक मोठी linear formula बनतात. Activations bends देतात — nets curves शिकू शकतात.
हे काय आहे?
What. शुरुवातीला common: hidden layers साठी ReLU (max(0, z)); शेवटी probabilities साठी sigmoid किंवा softmax.
कसं करायचं?
How.
तीन activations कागदावर try करा
- ReLU: negatives → 0; positives जसे आहेत तसे.
- Sigmoid: कोणताही number (0, 1) मध्ये squash.
- Softmax (multi-class नंतर): vector → probabilities, sum = 1.
import math
def relu(z): return max(0.0, z)
def sigmoid(z): return 1 / (1 + math.exp(-z))
for z in (-2, 0, 2):
print(z, "ReLU", relu(z), "sigmoid", round(sigmoid(z), 3))
Ravindra Bagale's Tip
Use ReLU as your default choice for hidden layers. For the output layer, choose the activation by the problem type: is the answer a plain number, or a probability (where sigmoid is common)?
Ravindra Bagale's Tip – मराठी
Hidden layers साठी ReLU हा default choice म्हणून वापरा. Output layer साठी activation problem type बघून निवडा: उत्तर साधा number आहे की probability (जिथे sigmoid सहसा वापरतात)?
Ravindra Bagale's Tip – हिंदी
Hidden layers के लिए ReLU को default choice की तरह इस्तेमाल करो. Output layer के लिए activation problem type देखकर चुनो: जवाब सादा number है या probability (जहाँ sigmoid आमतौर पर इस्तेमाल होता है)?