๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Deep Learning Notes
Topic #71

PReLU

PReLU (Parametric ReLU) takes Leaky ReLU's idea one step further: instead of fixing the negative slope \(\alpha\) as a hyperparameter you choose, PReLU makes \(\alpha\) a learnable parameter โ€” the network figures out the best slope for itself during training.

Formula

\[ \text{PReLU}(z) = \begin{cases}z & z \ge 0\\\alpha z & z < 0\end{cases} \]

Structurally identical to Leaky ReLU โ€” the only difference is that \(\alpha\) is now updated by gradient descent, just like any other weight, rather than fixed in advance.

How \(\alpha\) Gets Learned

\[ \frac{\partial \text{PReLU}}{\partial \alpha} = \begin{cases}0 & z \ge 0\\z & z < 0\end{cases} \]

Backpropagation computes this gradient just like any other parameter's gradient, and \(\alpha\) is updated via the same gradient descent rule from Gradient Descent. Each channel (in a CNN) or each layer can even have its own separate, independently-learned \(\alpha\), giving the network fine-grained control over how it handles negative activations in different parts of the architecture.

Code

import torch.nn as nn
import torch

layer = nn.PReLU(num_parameters=1, init=0.25)   # init is the starting value; it will be updated during training
x = torch.tensor([-2.0, 0.0, 2.0])
print(layer(x))

print(list(layer.parameters()))   # alpha is now a genuine, trainable nn.Parameter

Tradeoffs vs Leaky ReLU

Leaky ReLUPReLU
\(\alpha\)Fixed hyperparameter (e.g. 0.01)Learned parameter, adapted to the data
Extra parametersNoneOne (or more) additional learnable parameter(s) per layer/channel
Overfitting riskLower (fewer parameters)Slightly higher, especially on small datasets
FlexibilitySame slope everywhereCan adapt differently per channel/layer

Common Mistakes

  • Using PReLU by default on small datasets โ€” the extra learnable parameters add a small overfitting risk that isn't always worth it compared to simpler alternatives (ReLU, Leaky ReLU) when data is limited.
  • Assuming PReLU is strictly "more advanced, therefore better" โ€” it's a genuine tradeoff (flexibility vs. extra parameters/overfitting risk), and empirical testing on your specific task is the only way to know which wins.

Interview Relevance

Q: "What's the difference between Leaky ReLU and PReLU?" They share the exact same formula, but Leaky ReLU's negative-slope parameter \(\alpha\) is a fixed hyperparameter chosen before training, while PReLU treats \(\alpha\) as a learnable parameter, updated via backpropagation and gradient descent alongside the network's weights โ€” letting the model discover a task-appropriate slope automatically.

Practice Question

If a PReLU neuron's learned \(\alpha\) converges to a value very close to 0, what does the neuron's behavior become nearly equivalent to?

Want to go beyond the notes?

Join CodingNow 2.0's Deep Learning course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

PReLU โ€“ FAQs

Quick answers about learning PReLU in Deep Learning.

This free note from CodingNow 2.0 explains PReLU in Deep Learning โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on CodingNow 2.0, including PReLU, is 100% free with no signup required.
With focused practice, most students grasp PReLU in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now