Skip to content

Instantly share code, notes, and snippets.

@tieorange
Created May 6, 2015 20:28
Show Gist options
  • Save tieorange/2299116cea18c2698219 to your computer and use it in GitHub Desktop.
Save tieorange/2299116cea18c2698219 to your computer and use it in GitHub Desktop.
def activation(self, inputs_row):
# dot product calc
# inputs_row example = [-0.81239265210117029, 0.85921322532026534, -1, 1]
rez = 0
for w, i in zip(self.weights, inputs_row):
rez += w * i
if rez >= 0:
return 1
else:
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment