karpathy / convnetjs

Deep Learning in Javascript. Train Convolutional Neural Networks (or ordinary ones) in your browser.
MIT License
10.84k stars 2.04k forks source link

Saving experiences in Q-Learning #47

Open yconst opened 9 years ago

yconst commented 9 years ago

How would I go about if I wanted to save the experiences of the "Brain" object in Deep Q-Learning, and subsequently restore them and continue training? It seems that saving the "experience" object would suffice but I'm not sure..

Thanks

libraua commented 8 years ago

I think this would help. Converting brain to string (t);

var j = brain.value_net.toJSON();
var t = JSON.stringify(j); //brain as string

Loading brain from string (t);

var j = JSON.parse(t);
brain.value_net.fromJSON(j);