Aug-30-2019, 03:37 PM
Hey everyone,
This small perceptron is training with the delta rule and does not really make a great progress when it comes to learning.
The model should solve the simple OR-Problem.
This small perceptron is training with the delta rule and does not really make a great progress when it comes to learning.
The model should solve the simple OR-Problem.
def train(rounds): weight_one = 0.5 weight_two = 0.8 for i in range(rounds): input_one = r.randint(0,1) input_two = r.randint(0,1) if input_one == 0 and input_two == 0: wish_output = 0 else: wish_output = 1 learning_rate = 0.1 output = input_one * weight_one + input_two * weight_two print(i,' X1: ', input_one, ' X2: ', input_two, ' output = ', output) error = wish_output - output delta_weight_one = learning_rate * error * input_one delta_weight_two = learning_rate * error * input_two weight_one = weight_one + delta_weight_one weight_two = weight_two + delta_weight_two train(99999999)I hope someone is finding my mistake.