Skip to content

Instantly share code, notes, and snippets.

View nurtemiz's full-sized avatar
🚀
on my way!

Nur Temiz nurtemiz

🚀
on my way!
View GitHub Profile
@felipecruz
felipecruz / perceptron.py
Last active March 30, 2018 08:53
perceptron implementation for educational purposes
OR = (((0, 0), 0), ((0, 1), 1), ((1, 0), 1), ((1, 1), 1))
AND = (((0, 0), 0), ((0, 1), 0), ((1, 0), 0), ((1, 1), 1))
example = lambda x: x[0]
output = lambda x: x[1]
def train_perceptron(Is, Ws):
print("Xs: {} Ws: {}".format(example(Is), Ws))
learn_rate = 0.1
bias = 0