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 I manually set the connection weights? #331

Closed zac-garby closed 5 years ago

zac-garby commented 5 years ago

I cannot set the weights by using:

network.neurons().forEach(/* set weight */)

Because, (I assume) it makes a copy of the neurons instead of letting me access them directly. Is there any way I can set the weights myself instead of using .propagate()?

zac-garby commented 5 years ago

Update: I figured it out. For anybody interested, you have to iterate the layers and instead of using .neurons() to get the list of neurons, you use .list. After you've set the weights to what you want, you need to call network.optimized.reset()