{"_id":"@delight-im/neural-network","_rev":"6-b24a9e57ca583462c07c5a744129ff28","name":"@delight-im/neural-network","description":"Neural networks in JavaScript. Well-documented and object-oriented.","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@delight-im/neural-network","version":"1.0.0","description":"Neural networks in JavaScript. Well-documented and object-oriented.","main":"src/main.js","license":"Apache-2.0","author":{"name":"delight.im"},"repository":{"type":"git","url":"https://github.com/delight-im/JS-NeuralNetwork.git"},"keywords":["machine-learning","machine learning","neural-network","neural network","classifier","learning","neural","network"],"bugs":{"url":"https://github.com/delight-im/JS-NeuralNetwork/issues"},"homepage":"https://github.com/delight-im/JS-NeuralNetwork#readme","_id":"@delight-im/neural-network@1.0.0","scripts":{},"_shasum":"825882871dceb188774d04e8e07d30c4b6722512","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.1","_npmUser":{"name":"delight-im","email":"info@delight.im"},"dist":{"shasum":"825882871dceb188774d04e8e07d30c4b6722512","tarball":"https://registry.npmjs.org/@delight-im/neural-network/-/neural-network-1.0.0.tgz","integrity":"sha512-IY81wB9I6UVIEY+o9MKfw3byjxMvW3VPrbkXIp/U7Xv2k0uSnLQqe7tc09f4gssgvM02UqdG5ryzJ2+CTPQBNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyWj5CQe+qokuBZ/+hwIVIQpId5P78OVQFMQ+ylsvYrAiAVMJtw+Dg1gtt4xQN5xv2F7tbDVTIKtoU52w3jG0b4tg=="}]},"maintainers":[{"name":"delight-im","email":"info@delight.im"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/neural-network-1.0.0.tgz_1460056564502_0.10153620992787182"}},"1.0.1":{"name":"@delight-im/neural-network","version":"1.0.1","description":"Neural networks in JavaScript. Well-documented and object-oriented.","main":"src/main.js","license":"Apache-2.0","author":{"name":"delight.im"},"repository":{"type":"git","url":"https://github.com/delight-im/JS-NeuralNetwork.git"},"keywords":["machine-learning","machine learning","neural-network","neural network","classifier","learning","neural","network"],"bugs":{"url":"https://github.com/delight-im/JS-NeuralNetwork/issues"},"homepage":"https://github.com/delight-im/JS-NeuralNetwork#readme","dependencies":{"@delight-im/prng":"^1.0.0"},"gitHead":"8b5960f3019aa2da903de99f5a72d2c7b6258c3f","_id":"@delight-im/neural-network@1.0.1","scripts":{},"_shasum":"a469b465f6c562b5dcfcbd3aa98444e694ce0724","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.1","_npmUser":{"name":"delight-im","email":"info@delight.im"},"dist":{"shasum":"a469b465f6c562b5dcfcbd3aa98444e694ce0724","tarball":"https://registry.npmjs.org/@delight-im/neural-network/-/neural-network-1.0.1.tgz","integrity":"sha512-T9YJ2rmkuVKdQRiD4OJipadyXC7XSoMKHhvZh/ANg62LrX4tFjNxk8z4T6kyVDctaRuWbcAIvC9tAM2S3myGVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3pXqhqIfG8D+pSOXEYtodH9xUZ0XHafEjkKfcYVOnBAiEAoLfgjkk5A18IaUUIWyBw/xykVimUmusyYnZVaxVmfKU="}]},"maintainers":[{"name":"delight-im","email":"info@delight.im"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/neural-network-1.0.1.tgz_1460058173221_0.9633637734223157"}}},"readme":"# JS-NeuralNetwork\r\n\r\nNeural networks in JavaScript. Well-documented and object-oriented.\r\n\r\n## Installation\r\n\r\n * In the browser\r\n\r\n   ```html\r\n   <script type=\"text/javascript\" src=\"dist/browser-bundle.min.js\"></script>\r\n   ```\r\n\r\n * In Node.js\r\n\r\n   ```\r\n   $ npm install @delight-im/neural-network\r\n   ```\r\n\r\n   and\r\n\r\n   ```javascript\r\n   var NeuralNetwork = require(\"@delight-im/neural-network\");\r\n   ```\r\n\r\n## Usage\r\n\r\n * Creating a new instance\r\n\r\n   * Neural network with 3 input neurons and 1 output neuron\r\n\r\n     ```javascript\r\n     var network = new NeuralNetwork.Type.Feedforward(3, [], 1);\r\n     ```\r\n\r\n   * Neural network with 4 input neurons, 3 hidden neurons and 2 output neurons\r\n\r\n     ```javascript\r\n     var network = new NeuralNetwork.Type.Feedforward(4, [ 3 ], 2);\r\n     ```\r\n\r\n   * Neural network with 6 input neurons, two hidden layers with 4 and 2 neurons, and 3 output neurons\r\n\r\n     ```javascript\r\n     var network = new NeuralNetwork.Type.Feedforward(6, [ 4, 2 ], 3);\r\n     ```\r\n\r\n * Passing any number of additional options to the network\r\n\r\n   ```javascript\r\n   // pass an object containing the desired options as the fourth parameter\r\n   var network = new NeuralNetwork.Type.Feedforward(3, [ 4 ], 1, {\r\n       seed: 501935,\r\n       learningRate: 0.3,\r\n       hiddenLayerActivationFunction: new NeuralNetwork.Activation.HyperbolicTangent(),\r\n       outputLayerActivationFunction: new NeuralNetwork.Activation.BinaryStep()\r\n   });\r\n   ```\r\n\r\n * Available activation functions\r\n\r\n   ```javascript\r\n   new NeuralNetwork.Activation.ArcTangent();\r\n   new NeuralNetwork.Activation.BinaryStep();\r\n   new NeuralNetwork.Activation.GaussianFunction();\r\n   new NeuralNetwork.Activation.HyperbolicTangent();\r\n   new NeuralNetwork.Activation.Identity();\r\n   new NeuralNetwork.Activation.LogisticFunction();\r\n   new NeuralNetwork.Activation.RectifiedLinearUnit();\r\n   new NeuralNetwork.Activation.RectifiedLinearUnit(0.01);\r\n   new NeuralNetwork.Activation.SinusoidFunction();\r\n   ```\r\n\r\n * Training the network using supervised batch (\"all-at-once\") learning\r\n\r\n   ```javascript\r\n   // the first parameter is the array of inputs and the second parameter is the array of desired outputs\r\n   // the third parameter is the optional number of iterations and the fourth parameter is the optional error threshold\r\n   var error = network.trainBatch(\r\n       [\r\n           [0, 0, 1],\r\n           [0, 1, 1],\r\n           [1, 0, 1],\r\n           [1, 1, 1]\r\n       ],\r\n       [\r\n           [ 0 ],\r\n           [ 1 ],\r\n           [ 1 ],\r\n           [ 0 ]\r\n       ],\r\n       60000,\r\n       0.005\r\n   );\r\n   ```\r\n\r\n * Training the network using supervised online (\"single-pattern\") learning\r\n\r\n   ```javascript\r\n   // the first parameter is the input and the second parameter is the desired output\r\n   var error = network.train([0, 0, 1], [ 0 ]);\r\n   ```\r\n\r\n * Asking the network to predict some output from a supplied input pattern\r\n\r\n   ```javascript\r\n   // the single parameter is the input to process\r\n   network.predict([ 0, 0, 1 ])\r\n   ```\r\n\r\n * Saving the network with all its properties to a JSON string\r\n\r\n   ```javascript\r\n   var jsonStr = JSON.stringify(network);\r\n   ```\r\n\r\n * Restoring the network with all its properties from a JSON string\r\n\r\n   ```javascript\r\n   var network = NeuralNetwork.Type.Feedforward.fromJson(jsonStr);\r\n   ```\r\n\r\n## Development\r\n\r\n * Prerequisites\r\n\r\n   ```\r\n   $ npm install -g uglify-js\r\n   $ npm install -g browserify\r\n   ```\r\n\r\n * Building the browser bundle\r\n\r\n   ```\r\n   $ browserify src/main.js --standalone NeuralNetwork > dist/browser-bundle.js\r\n   $ uglifyjs dist/browser-bundle.js --compress --preamble \"$(< src/header.js)\" > dist/browser-bundle.min.js\r\n   $ rm dist/browser-bundle.js\r\n   ```\r\n\r\n * Running the Node.js examples\r\n\r\n   ```\r\n   $ node examples/node.js\r\n   ```\r\n\r\n## Contributing\r\n\r\nAll contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.\r\n\r\n## License\r\n\r\n```\r\nCopyright (c) delight.im <info@delight.im>\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n  http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n```\r\n","maintainers":[{"name":"delight-im","email":"info@delight.im"}],"time":{"modified":"2022-06-12T17:00:10.442Z","created":"2016-04-07T19:16:06.931Z","1.0.0":"2016-04-07T19:16:06.931Z","1.0.1":"2016-04-07T19:42:55.732Z"},"homepage":"https://github.com/delight-im/JS-NeuralNetwork#readme","keywords":["machine-learning","machine learning","neural-network","neural network","classifier","learning","neural","network"],"repository":{"type":"git","url":"https://github.com/delight-im/JS-NeuralNetwork.git"},"author":{"name":"delight.im"},"bugs":{"url":"https://github.com/delight-im/JS-NeuralNetwork/issues"},"license":"Apache-2.0","readmeFilename":"README.md","users":{"heyderpd":true,"meeh":true}}