cazala / synaptic

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

Small optimization + cleaning code #232

Closed wagenaartje closed 7 years ago

wagenaartje commented 7 years ago

A summary of the changes I made:

    this.layers = {
      input:  layers.input || null,
      hidden: layers.hidden || [],
      output: layers.output || null
    };
var myNetwork = new Architect.Perceptron(2, 2, 1)
var trainer = new Trainer(myNetwork)

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.

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.

cazala commented 7 years ago

Awesome @wagenaartje :D thanks for the PR, I just left one change request regarding the minification, everything else looks great 👍

wagenaartje commented 7 years ago

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: