Implement guess method
This commit is contained in:
parent
d61b090d92
commit
c431ed0fff
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user