var script document createElement script script type text javascript script src https cdnjs cloudflare com ajax libs synaptic 1 1 4 synaptic js document head appendChild script script onload function console log synaptic var perceptron new synaptic Architect Perceptron 2 3 1 var trainingData input 0 0 output 0 input 0 1 output 1 input 1 0 output 1 input 1 1 output 0 var learningRate 0 1 xor test for let i 0 i 20000 i let sample Math floor Math random trainingData length let d trainingData sample let err perceptron activate d input perceptron propagate learningRate d output if i 1000 0 console log err err let res perceptron activate 0 1 console log Test 0 1 res var script document createElement script script type text javascript script src https cdnjs cloudflare com ajax libs synaptic 1 1 4 synaptic js document head appendChild script script onload function console log synaptic var perceptron new synaptic Architect LSTM 1 3 3 1 var learningRate 0 1 xor test for let i 0 i 1000 i let input i 1000 let output Math sin input let err perceptron activate input perceptron propagate learningRate output if i 100 0 console log err err let res perceptron activate 0 console log Test 0 res
og err err let res perceptron activate 0 1 console log Test 0 1 res var script document createElement script script type text javascript script src https cdnjs cloudflare com ajax libs synaptic 1 1 4 synaptic js document head appendChild script script onload function console log synaptic var perceptron new synaptic Architect LSTM 1 3 3 1 var learningRate 0 1 xor test for let i 0 i 1000 i let input i 1000 let output Math sin input let err perceptron activate input perceptron propagate learningRate output if i 100 0 console log err err let res perceptron activate 0 console log Test 0 res