Perceptron: Difference between revisions

Content added Content deleted
(Added lua implementation)
m (→‎{{header|Lua}}: fixed typo)
Line 441: Line 441:
end
end
node:train(trainingData, 100, .1) --trains on the set for 100 epochs with a step size of 0.1
node:train(trainingData, 100, .1) --trains on the set for 100 epochs with a step size of 0.1
print("Trained results:")
print("\nTrained results:")
for i = -2, 2, 1 do
for i = -2, 2, 1 do
print(i..":", node:test({i}))
print(i..":", node:test({i}))
Line 453: Line 453:
1: 1.6849672607805
1: 1.6849672607805
2: 2.4325140849699
2: 2.4325140849699

Trained results:
Trained results:
-2: -3
-2: -3