Closed wagenaartje closed 7 years ago
Awesome @wagenaartje :D thanks for the PR, I just left one change request regarding the minification, everything else looks great 👍
Oops, didn't know about that. I just reverted the uglifyJS in a commit and made another commit to let the TravisCI check rerun (sometimes it just fails). Should be good to go :+1:
A summary of the changes I made:
for(var i in array)
! For arrays, always usefor(var i = 0; i < array.length; i++)
. Why? Have a look yourself: https://jsperf.com/var-i-in-array-vs-var-i-is-0/1. For me, thats a 97% speed difference! So basically, I changed this in the code as much as I can.set
could cause network.layers.hidden to beundefined
, so instead of doingthis.layers = layers
, it now works like:--require
does not come installed when you usenpm install
. And it is an unnecessary dependency anyways: just correctly using_inject-dist/src.js
intest/
for mocha testing is far more practical. Also removedmocha.opts
because it served no use.Neuron.squash.TANH
(maybe for a reason?), but I changed it to just use the built-in methodMath.tanh()
network.label
andnode.label
properties removed. They weren't used anymore and served no purpose. If a user wants to set a custom label, he/she can just doinstance.label =
.Perceptron
,LSTM
andLiquid
all usedthis.trainer = new Trainer(this)
. Why is this not stated in the documentation? The documentation even encourages:So I removed the Architect constructors to automatically create a
Trainer
for themselves (except for Hopfield). This was only used in mocha testing anyways, which I updated.synaptic.min.js
minified! Using uglifyJS webpack plugin. So I got these warnings:If you feel like I should change something about this, feel free to let me know! I might do some more optimization in the future.