๐ Challenge: Training - 3 Layered Neural Network
Train the 3 layered neural network so that it finds the optimal weights that classify the three letters.
We'll cover the following
Problem statement
Train the 3 layered neural network.
- Call the
forward_propagation
function. - Call the error function
calculate_error
and save the loss in each epoch. - Call the
backpropagation
function. - Call the
update_parameters
function to update the weights and biases in each epoch.
Sample input
- The input features:
X
- The target output:
y
- The weights of the three layers:
w1
,w2
, andw3
respectively - The bias of the three layers
b1
,b2
, andb3
respectively - Total epochs:
epochs
- The learning rate:
learning_rate
Sample output
- The updated weights and biases at the three layers respectively, i.e.,
w1
,b1
,w2
,b2
,w3
, andb3
- The cross-entropy loss in each epoch saved in the
losses
array
Coding exercise
Write your code below. It is recommendedโ to solve the exercise before viewing the solution.
๐ Note: There is a
train
function given in the code for testing purposes. Do not modify the function signature.
Good luck!๐ค
Get hands-on with 1200+ tech skills courses.