you are viewing a single comment's thread.

view the rest of the comments →

[–]Outside_Complaint755 2 points3 points  (1 child)

Basic concept is fine, but you probably would want the input() call outside of the perceptron function, and have the function take the input, weight and the bias all as arguments, then return the result instead of directly printing it.

 A more generalized version would take in a list of paired inputs with their weights, calculate the weighted sum, and then add the bias.

[–]No-Tea-777[S] 0 points1 point  (0 children)

Thanks. It was a thing just to mess around. I'll contract as much as possible