Zubnet AIसीखेंWiki › Activation Function
मूल सिद्धांत

Activation Function

ReLU, GELU, SiLU, Swish
एक mathematical function जो एक neuron के output पर apply होता है और network में non-linearity introduce करता है। Activation functions के बिना, एक neural network — चाहे कितना भी deep हो — सिर्फ linear relationships सीख पाता। ReLU, GELU, और SiLU/Swish modern architectures में सबसे common हैं।

यह क्यों matter करता है

Activation functions ही वजह हैं कि deep learning बिल्कुल काम करती है। Linear transformations का stack सिर्फ एक बड़ा linear transformation है। Layers के बीच activation functions network को complex, non-linear patterns सीखने देते हैं — वो curves, edges, और subtle relationships जो neural networks को powerful बनाते हैं।

Deep Dive

ReLU (Rectified Linear Unit) is the simplest: f(x) = max(0, x). It outputs zero for negative inputs and passes positive inputs unchanged. ReLU solved the vanishing gradient problem that plagued earlier activation functions (sigmoid, tanh) by providing a constant gradient of 1 for positive inputs. Its simplicity and effectiveness made it the default for over a decade.

Beyond ReLU

GELU (Gaussian Error Linear Unit) is now the standard in Transformers (used by BERT, GPT, and most LLMs). Unlike ReLU's hard cutoff at zero, GELU smoothly tapers near zero, which provides better gradient flow. SiLU/Swish (x · sigmoid(x)) is similar and used in some architectures like LLaMA. The practical differences between GELU and SiLU are small — both outperform ReLU in Transformer-scale models.

GLU Variants

Modern LLMs often use Gated Linear Units (GLU) and their variants (SwiGLU, GeGLU) in feed-forward layers. These multiply two parallel linear projections together, effectively letting the network gate what information passes through. SwiGLU (used in LLaMA, Mistral, and many others) combines SiLU activation with gating and consistently improves over standard feed-forward layers at the cost of slightly more parameters.

संबंधित अवधारणाएँ

← सभी Terms
Agent →