Activation Functions
Sigmoid, ReLU, and Softmax explained.
Activation Functions is a free Python Academy lesson on CoddyKit. This is lesson 2 of 5. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python Academy learning path, and your progress syncs across the web and the CoddyKit app. The Python Academy course includes 5 lessons in total.
The Role of Activation Functions
Activation Functions
Activation functions are a critical part of neural networks. They determine whether a neuron should be activated based on the input it receives.
Without activation functions, the neural network would behave as a linear model, limiting its ability to learn complex patterns.

Types of Activation Functions
Common types of activation functions include:
- Sigmoid: Outputs values between 0 and 1.
- ReLU (Rectified Linear Unit): Outputs the input if it's positive, otherwise 0.
- Softmax: Converts outputs into probabilities for classification tasks.
Sigmoid Function
The sigmoid function maps any input value to a range between 0 and 1, making it suitable for binary classification.
Formula:
σ(x) = 1 / (1 + e^(-x))
It squashes large inputs and outputs values close to 0 or 1.
ReLU Function
The ReLU (Rectified Linear Unit) function is defined as:
ReLU(x) = max(0, x)
It outputs 0 for negative inputs and the input value itself for positive inputs. ReLU is computationally efficient and helps address the vanishing gradient problem.
Softmax Function
The softmax function is used in the output layer for multi-class classification. It converts raw scores into probabilities:
Softmax(x_i) = e^(x_i) / Σ(e^(x_j))
All output values are normalized to sum up to 1.
Choosing the Right Activation Function
The choice of activation function depends on the task:
- Sigmoid: For binary classification.
- ReLU: For hidden layers in deep networks.
- Softmax: For multi-class classification problems.
Advantages of Activation Functions
Activation functions enable neural networks to:
- Learn complex, non-linear patterns.
- Differentiate between inputs effectively.
- Adapt to various types of data and tasks.
Challenges with Activation Functions
Some issues include:
- Sigmoid: Can cause vanishing gradients during training.
- ReLU: Can lead to 'dead neurons' where some neurons stop learning.
- Softmax: Computationally expensive for large outputs.
Summary and Next Steps
In this lesson, we:
- Explored activation functions like Sigmoid, ReLU, and Softmax.
- Learned their roles and use cases in neural networks.
- Discussed their advantages and challenges.
Next, we will build a simple feedforward neural network and understand its structure and working.

Learn Python with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 76
- Lessons
- 320
Frequently Asked Questions
Is the “Activation Functions” lesson free?
Yes — the full text of “Activation Functions” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python Academy course, upgrade to CoddyKit PRO. The Python Academy course includes 5 lessons in total.
What will I learn in “Activation Functions”?
Sigmoid, ReLU, and Softmax explained. You practise Python Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Python Academy?
No prior experience is required. Python Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 5.
How long does the “Activation Functions” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Python Academy lesson?
Yes. Every Python Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Introduction to Neural Networks
- Activation Functions
- Feedforward Neural Networks
- Backpropagation Algorithm
- First Neural Network with TensorFlow