Multilayer ANN For Regression 5107
Multilayer ANN For Regression 5107
No : 2403B05107
Course : M.Tech CSE Subject : Deep Learning Techniques
QUESTION 1 :
Do calculations to update the weights and bias parameters of the ANN model shown in
Figure 1 for one iteration. Training data samples are shown in Table 1. Random weights and
bias parameters are shown in Figure 1. Assume the learning rate η=0.1
ANSWER :
To update the weights and biases of the given artificial neural network (ANN) for one iteration
using backpropagation, we need to follow these steps:
Step 1: Forward Propagation
Here are the updated weights and biases after one iteration using backpropagation:
• Updated Weights:
o W11= 0.1495
o W12 = 0.2494
o W21 = 0.1989
o W22 = 0.2988
o W01 = 0.3395
o W02 = 0.3838
• Updated Biases:
o b1 = 0.1893
o b2 = 0.3884
o b0 = 0.4913
PROGRAM :
import numpy as np
# Given data
x1, x2, y_true = 0.05, 0.1, 0.01 # Input and target output
def sigmoid(z):
return 1 / (1 + np.exp(-z))
def sigmoid_derivative(a):
return a * (1 - a)
a1 = sigmoid(z1)
a2 = sigmoid(z2)
# Compute error
dE_dW01 = delta_o * a1
dE_dW02 = delta_o * a2
dE_db0 = delta_o
# Backpropagation - Hidden layer
dE_dW11 = delta_1 * x1
dE_dW12 = delta_2 * x1
dE_dW21 = delta_1 * x2
dE_dW22 = delta_2 * x2
dE_db1 = delta_1
dE_db2 = delta_2
# Print results
OUTPUT :