cazala / synaptic

architecture-free neural network library for node.js and the browser
http://caza.la/synaptic
Other
6.92k stars 666 forks source link

Can't save to JSON? #339

Closed madser123 closed 2 years ago

madser123 commented 5 years ago

Hi. I've been trying to save my network to a file so that i can use it without training it. The "toJSON" doesn't seem to create a file in the directory where my files are.

I'm doing this in the browser not via node.js.

I'm running the HTML file directly from my pc into chrome. I'm not using a server of any kind.

EDIT: it is now also giving me the error: fromJSON is not a function

termxz commented 5 years ago

Calling toJSON() function only makes an exact copy of the neural network and turns it into JSON format. Web Applications are not able to interact with the local file system, therefore you can't actually make a JSON file.

madser123 commented 5 years ago

Is there any way to actually "save" the network then? I want to save the trained weights so that i can use the network without training it.

ghost commented 5 years ago

Use Node.exe not Chrome or store the network in a cookie or cloud storage ..

madser123 commented 5 years ago

@Pummelchen Thanks! Never thought of cookies as an option. Any chance you have a code snippet as an example of how to do this? Sorry for asking so much..