Docsity

Computer science engineering, Summaries of Computer science

Toggle sidebar
bg1
UNIT 2
•Feed forward Networks-Multilayer Perceptron
• Gradient Descent
•Backpropagation
• Empirical Risk Minimization
• Regularization
•Auto encoders.
•Deep Neural Networks:
•Difficulty of training deep neural networks
•Greedy layer wise training.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45

Partial preview of the text

Download Computer science engineering and more Summaries Computer science in PDF only on Docsity!

UNIT 2

Feed forward Networks-Multilayer Perceptron

Gradient Descent

Backpropagation

Empirical Risk Minimization

Regularization

Auto encoders.

Deep Neural Networks:

Difficulty of training deep neural networks

Greedy layer wise training.

Empirical Risk Minimization

The basic idea behind Empirical Risk Minimization (ERM).

In simple terms:

True risk (expected risk): How well the model performs on all

possible future data from the real-world data distribution.

We cannot calculate this exactly because the true data

distribution is unknown.

Empirical risk: How well the model performs on the training

dataset that we actually have.

Since the training data is available, we can calculate this.

The empirical risk is the average loss over the data points.

Limitations

Low empirical risk does not always mean low true

risk.

A model may perform very well on training data but

poorly on new data.

This happens when the model memorizes the

training data instead of learning general patterns.

This problem is called overfitting.

Generalization helps the model perform well on

unseen data.

Regularization helps reduce overfitting and improves

generalization.

Hidden layers

These are where the real computation happens. We

have two Hidden layers, each containing four neurons.

Each neuron in a hidden layer does these three things:

Weighted sum: Each input is multiplied by a weight

and then all of them are summed.

Bias: A constant bias is added to give flexibility in

shifting the function.

Activation function: A non-linear squashing function

like ReLU, tanh, or sigmoid is applied. This step is what

allows the network to learn complex, non-linear

patterns.

Output layer

  • The output layer produces the final prediction, and its design depends on the

problem we are trying to solve:

  • Regression: Predicting continuous values, such as house prices. - Output Layer: 1 neuron with Linear Activation (or no activation) - Why Linear? House prices can be any real number, so the output should not be limited to a

fixed range.

  • Binary classification: Predicting one of two classes , such as whether an email is

Spam or Not Spam.

  • Output Layer: 1 neuron with Sigmoid Activation
  • Why Sigmoid? It produces an output between 0 and 1 , representing the probability of each

class.

  • Multi-class classification: Predicting one of three or more classes , such as

classifying an image as a Cat, Dog, or Horse.

  • Output Layer: One neuron for each class with Softmax Activation
  • Why Softmax? It converts the outputs into probabilities that add up to 1 , making it easy to

identify the most likely class.

Forward Propagation

Backpropagation Neural Network

Backpropagation (short for "Backward Propagation of Errors") is a method used to

train artificial neural networks.

Its goal is to reduce the difference between the model’s predicted output and the

actual output by adjusting the weights and biases in the network.

It works iteratively, minimizing the cost function by adjusting weights and biases.

In each epoch, the model adapts these parameters, reducing loss by following the error

gradient.

The algorithm computes the gradient using the chain rule from calculus,

allowing it to effectively navigate complex layers in the neural network to

minimize the cost function.

Backpropagation UNIT-

Why is Backpropagation Important?

Efficient Weight Update : It computes the gradient of the loss function with respect to each

weight using the chain rule, making it possible to update weights efficiently.

Scalability: The backpropagation algorithm scales well to networks with multiple layers

and complex architectures, making deep learning feasible.

Automated Learning : With backpropagation, the learning process becomes automated,

and the model can adjust itself to optimize its performance.

Backpropagation

Backpropagation is the process of improving a neural network by reducing

prediction errors. It works as a feedback mechanism , helping the network learn

from its mistakes.

The steps involved are:

  • Compare Predictions :Compare the predicted output ( ŷ ) with the actual output ( y ).
  • Calculate the Error :Use a loss function (such as Mean Squared Error (MSE) or Cross-

Entropy Loss) to measure the prediction error.

  • Backpropagate the Error :Compute the gradients of the loss with respect to each

weight and bias using the chain rule. These gradients indicate how each parameter affects

the error.

  • Update Weights and Biases: Adjust the weights and biases using Gradient

Descent to reduce the loss.

This process is repeated until the model achieves the desired accuracy.

Feed Forward Neural Network UNIT-

Backpropagation in FNN

Learning process uses Backpropagation algorithm:

Forward pass: Compute outputs.

Compute loss (error).

Backpropagation: Adjust weights using gradient descent.

Repeat until convergence.

Backpropagation UNIT-

Backpropagation often utilizes optimization algorithms like gradient descent or stochastic

gradient descent.

Backpropagation UNIT-

x

Backpropagation UNIT-

x