Deep Learning
Deep Learning
DEEP LEARNING ?
NEURAL NETWORKS ?
A neural network is a computational model inspired by the human brain
that is used in machine learning and artificial intelligence. It consists of
layers of interconnected neurons (also called nodes), which process and
transmit information.
ANN >>
Artificial Neural Networks contain artificial neurons which are called units.
Artificial Neural Network has an input layer, an output layer as well as
hidden layers. The input layer receives data from the outside world which
the neural network needs to analyze or learn about. Then this data passes
through one or multiple hidden layers that transform the input into data that
is valuable for the output layer. Finally, the output layer provides an output
in the form of a response of the Artificial Neural Networks to input data
provided. As the data transfers from one unit to another, the neural network
learns more and more about the data which eventually results in an output
from the output layer.
STRUCTURE OF ANN
PERCEPTRON :
A perceptron is a neural network unit that does a precise computation to
detect features in the input data. Perceptron is mainly used to classify the
data into two parts. Therefore, it is also known as Linear Binary Classifier.
Perceptron uses the step function. The activation function is used to map
the input between the required value like (0, 1) or (-1, 1).
o Input value or One input layer: The input layer of the perceptron is made
of artificial input neurons and takes the initial data into the system for
further processing.
o Weights and Bias:
Weight: It represents the dimension or strength of the connection between
units. If the weight to node 1 to node 2 has a higher quantity, then neuron 1
has a more considerable influence on the neuron.
Bias: It is the same as the intercept added in a linear equation. It is an
additional parameter which task is to modify the output along with the
weighted sum of the input to the other neuron.
o Net sum: It calculates the total sum.
o Activation Function: A neuron can be activated or not, is determined by
an activation function. The activation function calculates a weighted sum
and further adding bias with it to give the result
LIMITATIONS OF ANN ;
1. Computational Complexity
● Overfitting: ANN learns too much from training data and fails on new
data.
● Underfitting: ANN fails to capture complex patterns due to insufficient
training.
6. Hyperparameter Sensitivity
7. Lack of Standardization
FORWARD PROPAGATION :
Forward propagation (or forward pass) refers to the calculation and storage of
intermediate variables (including outputs) for a neural network in order from the input
layer to the output layer.
Forward is same as normal neural network.
Weights, bias, activation function and all
BACKWARD PROPAGATION :
Backpropagation (Backward Propagation of Errors) is a supervised learning
algorithm used to train artificial neural networks. It minimizes the error by
adjusting weights and biases through gradient descent.
NUMERICALS
ACTIVATION FUNCTION :
If hum ye func use nahi krenge toh hmara neural network non linear data
capture nahi kr payega sirf linear data hi capture krega.
An activation function determines the output of a neuron in a neural network
by adding non-linearity, enabling the network to learn complex patterns from
the data.
Types of Activation Functions
The output ranges between 0 and 1, hence useful for binary classification.
Hinge loss
This loss function works well for classification problems when target values
are in the set of {-1,1}.
Binary cross entropy
This loss function measures the difference between predicted binary
outcomes and actual values.
OPTIMISER:
Improve the speed of training. Minimise the loss function like gradient
descent. There are three types of gradient descent :
Batch : entire dataset
Stochastic : data ko dekhte ho after every data point
Mini batch: batch size update after each batch size
●
● Bias correction :
Regularization methods :
It is a technique used to reduce errors by fitting the function appropriately
on the given training set and avoiding overfitting.
L1:(Lasso) Least absolute shrinkage and selection operator. It adds
the absolute value of magnitude of the coefficient as a penalty term to the
loss function. It also helps us achieve feature selection by penalizing the
weights approx to zero that does not serve any purpose in the model.
Best for: Sparse models where feature selection is important.
During Training:
● Each neuron is randomly deactivated (set to 0) with probability ppp
(e.g., p=0.2p = 0.2p=0.2 means 20% of neurons are dropped).
● The remaining active neurons are scaled up by 11−p\frac{1}{1 - p}1−p1
to maintain the overall scale of activations.
During Testing:
❌
❌ When NOT to use Dropout?
❌ IfNottheusually
dataset is small, dropout may remove too much information.
needed in Batch Normalization, as BN already stabilizes activations.
Batch Normalisation :
It speeds up training.
Tuning Strategy:
2. Batch Size
3. Number of Epochs
Tuning Strategy:
Tuning Strategy:
Tuning Strategy: