synaptic icon indicating copy to clipboard operation
synaptic copied to clipboard

Fail to save and reuse a network

Open aurium opened this issue 8 years ago • 1 comments

@Jabher points some data is lost by toJSON in #112. I don't find a problem there, however i'm having trouble while trying to reuse a network thought page loads.

var brain = synaptic.Network.fromJSON(JSON.parse(localStorage[key]));
(... training ... using ...)
localStorage[key] = JSON.stringify(brain.toJSON());

...unhappily after page reload the network is not acting as before.

How to solve this problem now (before v2)?

aurium avatar May 05 '17 19:05 aurium

Do you have an example of the network? Here I tried a simple Perceptron + XOR, the first time you run it, it trains the network, stores it in LS, and activates it. The next times it will retrieve it from LS and activate it. You get the exact same result every time: https://jsfiddle.net/jrwqaxbp/6/

cazala avatar May 22 '17 15:05 cazala