Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeuralNetwork (de)serialization does not preserve activation function #96

Open
enginefeeder101 opened this issue Mar 10, 2018 · 0 comments · May be fixed by #97
Open

NeuralNetwork (de)serialization does not preserve activation function #96

enginefeeder101 opened this issue Mar 10, 2018 · 0 comments · May be fixed by #97

Comments

@enginefeeder101
Copy link
Contributor

Currently the (de)serialization features of the NeuralNetwork library does not preserve the activation function. The default activation function (currently sigmoid) will be used after deserialization.

This could be fixed by adding a replacer function to JSON.stringify().

enginefeeder101 added a commit to enginefeeder101/Toy-Neural-Network-JS that referenced this issue Mar 10, 2018
This fixes CodingTrain#96 by using a `replacer` on serialization to preserve the activation function as a string.
On deserialization the function string is `eval()`-ed. This is dangerous as malicious code could be
executed. Might be possible to port this to using `new Function()` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant