📘 Lesson · Lesson 90
Activation Functions
Activation Function क्या है?
💡 एक नज़र में
Activation function तय करती है कि neuron "fire" करे या नहीं। यह non-linearity जोड़ती है ताकि neural networks जटिल patterns सीख सकें।
Common Functions
| Function | Output Range | Use |
|---|---|---|
| Sigmoid | 0 से 1 | binary output / probabilities |
| Tanh | -1 से 1 | hidden layers (zero-centered) |
| ReLU | 0 से अनंत | deep networks में सबसे common |
Code में
Python
import numpy as np def relu(x): return np.maximum(0, x) def sigmoid(x): return 1 / (1 + np.exp(-x)) print(relu(-3), relu(5)) # 0 5 print(round(sigmoid(0), 2)) # 0.5
0 5
0.5
सारांश
- Activation functions neural networks में non-linearity जोड़ती हैं।
- ReLU सबसे common; Sigmoid probabilities के लिए; Tanh zero-centered।
💻 लाइव कोड एडिटर
इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.