This commit is contained in:
2019-10-23 16:38:50 +02:00
parent 80319712d0
commit 8511af2e2c
5 changed files with 83 additions and 44 deletions

View File

@@ -14,9 +14,14 @@ class Neural_Network(object):
self.fitness = 0
#weights
if not W1 :
if W1 is not None:
self.W1=W1
else :
self.W1 = np.random.randn(self.inputSize, self.hiddenSize) # weights from input to hidden layer
if not W2 :
if W2 is not None:
self.W2=W2
else :
self.W2 = np.random.randn(self.hiddenSize, self.outputSize) # weights from hidden to output layer
# self.w1 = [[random.random() for i in range(self.hiddenSize)] for i in range(self.inputSize)]
# self.w2 = [[random.random() for i in range(self.outputSize)] for i in range(self.hiddenSize)]