You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a perceptron with a small modification - allowing the weights (and features) to be strings. This may be more natural in settings such as text caterogization. Example:
I wrote a perceptron with a small modification - allowing the weights (and features) to be strings. This may be more natural in settings such as text caterogization. Example:
var bird = perceptron()
bird.train({'wings': 2, 'legs': 2}, 1)
bird.train({'wings': 0, 'legs': 2}, 0)
bird.train({'wings': 2, 'legs': 4}, 0)
bird.train({'wings': 0, 'legs': 4}, 0)
while(!bird.retrain());
test.equal(bird.perceive({'wings': 2, 'legs': 2}), 1)
test.equal(bird.perceive({'wings': 0, 'legs': 2}), 0)
test.equal(bird.perceive({'wings': 2, 'legs': 4}), 0)
test.equal(bird.perceive({'wings': 0, 'legs': 4}), 0)
Would you like to add it?
The text was updated successfully, but these errors were encountered: