ANN Unit IV Notes
ANN Unit IV Notes
ANN Unit IV Notes
Activation functions are used in neural networks to introduce non-linearity into the model, helping
a) Identity Function
- Formula: f(x) = x
- Explanation: This is a linear function where the output is the same as the input. It is mainly used in
- Use Case: Not often used in hidden layers as it cannot learn complex patterns, but it can be used
in regression problems.
- Formula:
- Explanation: It outputs a 1 if the input exceeds a certain threshold (usually 0) and outputs a 0
otherwise.
- Use Case: Useful for binary classification problems but not differentiable, limiting its use in complex
networks.
- Explanation: ReLU is the most commonly used activation function in deep learning, solving the
- Use Case: Used in convolutional and deep networks for tasks like image processing, NLP, etc.
d) Sigmoid Function
- Explanation: Outputs values between 0 and 1, useful for probabilistic outputs but suffers from
vanishing gradients.
- Use Case: Binary classification tasks, often used in the output layer.
- Explanation: Similar to sigmoid but outputs values between -1 and 1, making it useful for
backpropagation.
f) Leaky ReLU
- Explanation: Allows small negative values to prevent the dying ReLU problem.
- Use Case: Used in deep learning networks for image processing tasks.
The Backpropagation Algorithm trains neural networks by minimizing the error using gradient
descent.
Steps:
3. Compute Error: Calculate the difference between predicted and actual output.
4. Backward Pass: Propagate errors back through the network to adjust the weights.
Example:
If the actual output is 0.8 and the network predicts 0.5, the error will be propagated back to adjust
the weights, reducing the difference between prediction and actual output.
- No hidden layers.
- Use Case: Suitable for simple linear problems like basic classification.
- Use Case: Used in tasks like speech recognition and time series forecasting.
The more hidden layers, the more abstract and complex relationships the network can learn.
Cost Function:
A well-adjusted learning rate ensures faster convergence without overshooting or getting stuck in
local minima.