2021-12-18 20:57:44 +01:00
|
|
|
import numpy as np
|
2021-12-22 22:08:20 +01:00
|
|
|
from sys import path
|
|
|
|
path.insert(1, "..")
|
2021-12-18 20:57:44 +01:00
|
|
|
from sobek.network import network
|
|
|
|
|
|
|
|
myNetwork = network(2, 1)
|
|
|
|
|
|
|
|
test = []
|
|
|
|
test.append(np.zeros(2))
|
|
|
|
test.append(np.zeros(2))
|
|
|
|
test.append(np.zeros(2))
|
|
|
|
test.append(np.zeros(2))
|
|
|
|
test[1][1] = 1.0
|
|
|
|
test[2][0] = 1.0
|
|
|
|
test[3][0] = 1.0
|
|
|
|
test[3][1] = 1.0
|
|
|
|
|
|
|
|
myNetwork.weights = [np.array([[-10.0, -10.0]])]
|
|
|
|
myNetwork.biases = [np.array([15.0])]
|
|
|
|
print(myNetwork.weights)
|
|
|
|
print(myNetwork.biases)
|
|
|
|
|
|
|
|
print("0 0 : " + str(myNetwork.process(test[0])) + " == 1 ?")
|
|
|
|
print("0 1 : " + str(myNetwork.process(test[1])) + " == 1 ?")
|
|
|
|
print("1 0 : " + str(myNetwork.process(test[2])) + " == 1 ?")
|
|
|
|
print("1 1 : " + str(myNetwork.process(test[3])) + " == 0 ?")
|