CodingTrain / Toy-Neural-Network-JS

Neural Network JavaScript library for Coding Train tutorials
MIT License
425 stars 242 forks source link

Added de- and serialization functions. #50

Closed enginefeeder101 closed 6 years ago

enginefeeder101 commented 6 years ago

I added functions for serialization and deserialization of the Matrix and NeuralNetwork classes. For the Matrix library I added a test as well.

You can now save the state of your NeuralNetwork:

let nn = new NeuralNetwork(2,2,1);
localStorage.setItem('nn', nn.serialize())

Continue using the NeuralNetwork:

let nn = NeuralNetwork.deserialize(localStorage.getItem('nn'));
shiffman commented 6 years ago

Amazing, this is one I wanted to do a tutorial about so you might see me live coding this feature soon. . hopefully I'll remember to reference and thank this pull request!