1725876123-Unit 1 Fundamental of Deep Learning
1725876123-Unit 1 Fundamental of Deep Learning
Introduction to
Gen-AI
Unit - 4
Unit - 1
Source :
www.freepik.com/
What is Deep Learning?
Source :
Reference link
Machine Learning Vs Deep Learning
Source :
Reference
Deep Neural Networks(DNN)
Source :
Reference link
Neurons
Source :
Reference link
Weights and Bias
Input 1
Source :
Reference link
Components of Artificial Neuron
Source :
Reference link
Single Neuron
Source :
Reference link
Representation of DNN
Forward Propagation
Source :
Reference link
Working of ANN
Epochs
Batch Size
• Total number of training examples present in a single
batch.
• Note: Batch size and number of batches are two
different things.
Hyperparameters in Neural Network
Dropout
Activation Function
• Activation functions are used to introduce nonlinearity to models, which allows deep learning
models to learn nonlinear prediction boundaries.
• The Activation Functions can be basically divided into 2 types-
1. Linear Activation Function
2. Non-linear Activation Functions
• Several different types of Activation functions are used in Deep Learning.
• Few examples are Sigmoid function, Tanh function, ReLu function, Leaky ReLu function, Maxout
function, ELU function, etc.
Hyperparameters related to Network Structure
Source :
Reference link
Hyperparameters related to Network Structure
Source :
Reference link
Hyperparameters related to Network Structure
Source :
Reference link
Hyperparameters related to Network Structure
● The Maxout activation is a generalization of the ReLU and the leaky ReLU functions.
● It is used in conjunction with the dropout regularization technique.
Source :
Reference link
Hyperparameters related to Network Structure
Source :
Reference link
Vanishing Gradient Descent
● Vanishing Gradient Descent is a challenge that emerges during backpropagation when the
derivatives or slopes of the activation functions become progressively smaller as we move
backward through the layers of a neural network.
● The vanishing gradient problem is particularly associated with the sigmoid and hyperbolic
tangent (tanh).
● We can fix this problem using different methods. Some methods includes Batch Normalization,
choosing right activation functions. For eg, choosing Activation function like Rectified Linear
Unit (ReLU) for the hidden layers in neural network.
Hyperparameters related to Training Algorithm
Learning Rate
• Gradient Descent is known as one of the most used optimization algorithms to train machine learning
models by means of minimizing errors between actual and expected results.
• Gradient descent was initially discovered by "Augustin-Louis Cauchy" in the mid 18th century.
• Gradient Descent is defined as one of the most used iterative optimization algorithms of machine
learning to train the machine learning and deep learning models. It helps in finding the local minimum
of a function.
The best way to define the local minimum or local maximum of a function using gradient descent
is as follows:
• If we move towards a negative gradient or away from the gradient of the function at the current point,
it will give the local minimum of that function.
• Whenever we move towards a positive gradient or towards the gradient of the function at the current
point, we will get the local maximum of that function.
Gradient Descent
Source :
Reference link
Gradient Descent
Source :
Reference link
Hyperparameters related to Training Algorithm
Number of epochs
Number of epochs is the number of times the whole training data is shown to the network while training.
Increase the number of epochs until the validation accuracy starts decreasing even when training accuracy is
increasing(overfitting).
Batch size
Mini batch size is the number of sub samples given to the network after which parameter update happens.
A good default for batch size might be 32. Also try 32, 64, 128, 256, and so on.
Loss Functions
A loss function, that can be used to estimate the 1. Binary Classification Loss Functions
loss of the model so that the weights can be • Binary Cross-Entropy
updated to reduce the loss on the next evaluation.
• Hinge Loss
• Regression Loss Functions
• Squared Hinge Loss
• Mean Squared Error Loss
Tensor
• TensorFlow Applications
Syntax:
import tensorflow as tf
Building a model in Keras
1
Define Network
2
Compile Network
3
Fit Network
4
Evaluate Network
5
Make Predictions
What is Keras?
• Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow.
• It was developed with a focus on enabling fast experimentation. Being able to go from idea to result as fast
as possible is key to doing good research.
Source :
Reference link
Lab - 1
Answer: D
Mean Squared Error
Quiz
Answer: C
Updating neural network weights
Quiz
Answer: C
One complete iteration through the training dataset
Quiz
a) Regularization
b) Batch normalization
c) Data augmentation
d) Max-pooling
Answer: B
Batch normalization
Quiz
a) Feature engineering
b) Data visualization
c) Automatic feature learning
d) Data preprocessing
Answer: C
Automatic feature learning
Thank You