Code the Perceptron Output
We'll cover the following...
Press + to interact
def weighted_sum(a,b):output = 0for i in range(len(a)):output += (a[i] * b[i])return outputdef perceptron(input, weights):pred = weighted_sum(input,weights)return predweights = [1, 1]input = [2,3]output = perceptron(input, weights)print(node_0_value)
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy