synaptic
synaptic copied to clipboard
Cannot Replicate Hopfield Wiki Example
I cannot replicate this example: https://github.com/cazala/synaptic/wiki/Architect#hopfield
This is the output in a REPL
> hopfield = new tic.Architect.Hopfield(10)
> hopfield.learn([
... [0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
... [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]
... ])
> hopfield.feed([0,1,0,1,0,1,0,1,1,1])
[ 0, 1, 0, 0, 1, 0, 0, 1, 0, 1 ]
> hopfield.feed([1,1,1,1,1,0,0,1,0,0])
[ 0, 1, 0, 0, 1, 1, 0, 1, 0, 1 ]
>
I also noticed this issue. I tried to run hopfield learning multiple times, but feed often misses result. That is probably some mistake, because in my case minimum error after training is less then 0.00005, so feed data can not be that wrong.
Seems to be working fine for me. JSFiddle
Maybe you will have some more success with Neataptic, the front-end is very similar to Synaptic but the back-end is rather different.
@wagenaartje i see you added hopfield in Neataptic. Thank you for that!