x1 = np.linspace(-2, 2, 50)
x2 = np.linspace(-2,2, 50)
x3 = z = np.linspace(-1,1,50*50);
result = np.zeros((50*50,3))
# result from first layer are stored here
out11 = np.zeros((50*50,1))
out12 = np.zeros((50*50, 1))
out13 = np.zeros((50*50, 1))
out14 = np.zeros((50*50, 1))
# result from output layer are stored here
out2 = np.zeros((50*50, 1))
for i in range(len(x1)):
for j in range(len(x2 )):
# We took each layer and multiplied them by the weight values, input values and added the bias connected to each one of them
# Neurons for the first layer (4)
z_1_1 = x1[i] * w['w1'][0][0] + x2[j] * w['w1'][1][0] + b['b1'][0]
a_1_1 = relu(z_1_1)
z_1_2 = x1[i] * w['w1'][0][1] + x2[j] * w['w1'][1][1] + b['b1'][1]
a_1_2 = relu(z_1_2)
z_1_3 = x1[i] * w['w1'][0][2] + x2[j] * w['w1'][1][2] + b['b1'][2]
a_1_3 = relu(z_1_3)
z_1_4 = x1[i] * w['w1'][0][3] + x2[j] * w['w1'][1][3] + b['b1'][3]
a_1_4 = relu(z_1_4)
# Neuron for the last layer (1)
z_2 = a_1_1 * w['w2'][0][0] + a_1_2 * w['w2'][1][0] + a_1_3 * w['w2'][2][0] + a_1_4 * w['w2'][3][0] + b['b2'][0]
a_2 = sigmoid(z_2)
# This is our dummy dataset
result[i*50+j,0 ] = x1[i]
result[i*50+j, 1] = x2[j]
# Assigning the output of each layer to an output variable
out11[i*50+j] = a_1_1
out12[i*50+j] = a_1_2
out13[i*50+j] = a_1_3
out14[i*50+j] = a_1_4
out2[i*50+j] = a_2