Skip to content

Instantly share code, notes, and snippets.

@anshmidt
anshmidt / perceptron_example.py
Created August 2, 2018 20:43
Simple example of perceptron
inputs = [0, 1, 0, 0]
weights = [0, 0, 0, 0]
desired_result = 1
learning_rate = 0.2
trials = 6
def evaluate_neural_network(input_array, weight_array):
result = 0
for i in range(len(input_array)):
layer_value = input_array[i] * weight_array[i]