diff --git a/brain.py b/brain.py index 0cc48d5..6245d11 100644 --- a/brain.py +++ b/brain.py @@ -13,9 +13,9 @@ class Neural_Network(object): # inspired from https://enlight.nyc/projects/neural-network/ def __init__(self, W1=None, W2=None): # parameters - self.inputSize = 3 + self.inputSize = 4 self.outputSize = 2 - self.hiddenSize = 3 + self.hiddenSize = 4 self.fitness = 0 # weights diff --git a/car.py b/car.py index a159ea8..3b3242f 100644 --- a/car.py +++ b/car.py @@ -139,7 +139,7 @@ class Car(pygame.sprite.Sprite): # print(self.probes) def probe_brain(self): - res = self.brain.predict(np.array(self.probes)) + res = self.brain.predict(np.array(self.probes + [self.speed])) self.heading_change = res[0] * 30 self.throttle = res[1] * 5