Implement guess method

This commit is contained in:
George Lacey 2017-02-10 12:12:44 +00:00
parent 19d60f0b92
commit 8d918a9434

View File

@ -27,6 +27,11 @@ class Perceptron(object):
print("Total = %f" % input) print("Total = %f" % input)
if input > 0: if input > 0:
return True return 1
else: else:
return False return -1
def guess(self, p_desired):
prediction = float(self.activation())
return p_desired - prediction