Professional Documents
Culture Documents
• Course Code:
• Unit 1
Introduction to Deep learning
• Lecture 4
Activation function & Loss
function
Activation function
Source: https://medium.com/@MrBam44/activation-functions-in-deep-
learning-models-how-to-choose-3ad007eaf998
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Why Activation Function?
• Application of the activation function tells
us that which neurons in each layer will be
triggered. Only the neurons with some
relevant information are activated in every
layer.
• The activation takes place depending on
some rule or threshold
• The purpose of the activation function is
to introduce non-linearity into the
network. Example : Separating green points
• As most of the data in real life is non from red points in the graph.
linear.
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Can we do without an
activation function? • As it introduces an additional step at each
layer during the forward propagation,
increases complexity
• In that case, every neuron will only perform a
linear transformation on the inputs using the
weights and biases that make it simpler and
unable to learn the complex patterns from
data.
• without an activation function it is just a
linear regression model.
• activation function introduces non-linearity in
the network.
Non-linearities
Linear Activation
allow us to
functions produce
approximate
linear decisions
arbitrarily
no matter the complex
network size functions
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Types of Activation Function
Binary
Linear Sigmoid
step
Leaky
Tanh ReLu
ReLu
Softmax
Output:
output value becomes less sensitive.
(0.9990889488055994, Even a large change in input values
2.7894680920908113e-10)
results in little to no change in the
output value
Loss Cost
Function Function
Is loss for
a single
Is the
average
Regression loss Classification Loss
training loss over
example/ the entire • MSE (Mean square error ) • Binary cross-entropy
input training
dataset. • MAE (Mean absolute error) • Categorical cross-entropy