ID: 2597957
Homework 1
Problem 1:
From the script generate_two_moons, the meaning of input/output variables:
[X,Y,Xt] = generate_two_moons(r,w,d,N,seed,display)
Input:

Output:

Result:
Homework 1
Problem 2:
From the script NN_Perception(dist), variable dist represent the distance between two moons.
The weight/bias vector w(n) is represented by a 31 vector.
The input data x(n) is being stored by a 31 vector in which first element is 1, the other elements
are coordinates of a randomly selected point in (number of training + number of testing sets)
samples.
The desired values d(n) are being stored by the value of class (1: class 1, 1: class 2) from the
selected point.
The learning rate parameter (n) is being stored by a 1 [number of training sets] vector
The learning rate parameter is not constant. It is being adjusted by decreasing the learning rate
from 0.9 to 0.00001 in 1000 steps
The number of training epochs is 50.
Results of running the script with radius = 10, width = 6, distance = 4, number of training sets:
1000, number of testing sets = 2000, epochs = 50.
Homework 1
Problem 3:
a.
Find the bias and weight for:
AND operation
OR operation
COMPLEMENT operation
For OR operation:
X0
1
1
1
1
X1
0
0
1
1
X2
0
1
0
1
Y
0
1
1
1
Result:
3
Homework 1
Testing:
X1
X2
0
0
1
1
0
1
0
1
V=
w.x
+b
0.1
0
0
0.1
0
1
1
1
X0
1
1
1
1
Result:
Testing:
X1
0
0
1
1
X2
0
1
0
1
Y
0
0
0
1
X2
0
0
1
1
0
1
0
1
V=
w.x
+b
0.2
0.1
0
0.1
0
0
0
1
X0
1
1
Result:
X1
1
0
X2
0
1
Homework 1
V=
w.x
0.2
0
+b
Y
1
0
Homework 1
Problem 4:
Homework 1
Problem 5:
Running NN_Perception script for distance d = 0:
Learning Curve
