anubisthejackle / 2048-Deep-Learning

MIT License
77 stars 33 forks source link

Allow saving / loading of networks #5

Open anubisthejackle opened 9 years ago

anubisthejackle commented 9 years ago

As the subject says, utilize ConvNetJS' save/load functionality to allow for multi-session networks.

jabrena commented 8 years ago

I will try to add some feature to store data into local storage to refresh the url and load the NN in the same status that previous state. http://www.w3schools.com/html/html5_webstorage.asp

What is

anubisthejackle commented 7 years ago
function savenet() {
  var j = w.agents[0].brain.value_net.toJSON();
  var t = JSON.stringify(j);
  document.getElementById('tt').value = t;
}

function loadnet() {
  var t = document.getElementById('tt').value;
  var j = JSON.parse(t);
  w.agents[0].brain.value_net.fromJSON(j);
  stoplearn(); // also stop learning
  gonormal();
}
anubisthejackle commented 7 years ago

The above is how Karpathy handles it on his demo for the deepqlearn class