In this assignment you are required to create a Python program that does the following:
(Note: You may not use any Python machine learning libraries other than numpy.)
(a) Implement a neural network with 3 layers with the following specifications:
the input layer has 4 nodes
the hidden layer has 8 nodes
the output layer has 3 nodes
all nodes in the hidden layer and output layer use sigmoid activation function
all weights are initialised to 1
all bias values are initalised to 1(b) You need to implement the feedforward step to compute the output of the network for some
given inputs.(c) You need to implement the sum-of-squares loss computation between the output and
target.Recall: sum-of-squares loss is L(y, t) = 1
2
Pk
j=1(yj − tj )
2
.(d) You need to implement the backpropagation method for updating the weights and biases
of the network. Use a learning rate of 0.1.Your Python submission to moodle will be a .py file that does the following:
(1) Read in from standard input a list of seven numbers, such as
−2
1
0.5
−1
0
0
1The first 4 values are the input to the network and the last 3 are the corresponding targets.
(2) Feedforward the input values to obtain output values and compute the sum-of-squares loss
with respect to the target values.
(3) Perform one iteration of backpropagation.(4) After that, feedforward the same input values into the updated network to get new output
values, and compute a new loss value.
(5) The following values must be output using standard output:
the loss before training and the loss after training, rounded to 4 decimal places.
Only round off at the end of the computation.For the above input, the output should be:
0.9652
0.9647
Here is another example:
input
1.4
0
−2.5
−3
0.4
0.6
0
output
0.4107
0.4072
4030A, Adaptive, Assignment, Computation, COMS, Learning, Machine, solved
[SOLVED] Coms 4030a adaptive computation and machine learning assignment 1
$25
File Name: Coms_4030a_adaptive_computation_and_machine_learning_assignment_1.zip
File Size: 612.3 KB
Reviews
There are no reviews yet.