{"id":13797527,"url":"https://github.com/totemstech/neuraln","last_synced_at":"2026-03-14T12:09:10.648Z","repository":{"id":20867896,"uuid":"24154875","full_name":"totemstech/neuraln","owner":"totemstech","description":null,"archived":false,"fork":false,"pushed_at":"2015-06-29T16:05:08.000Z","size":273,"stargazers_count":274,"open_issues_count":3,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-24T18:44:02.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/totemstech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-17T17:25:55.000Z","updated_at":"2025-01-24T05:36:30.000Z","dependencies_parsed_at":"2022-08-30T17:40:45.091Z","dependency_job_id":null,"html_url":"https://github.com/totemstech/neuraln","commit_stats":null,"previous_names":["teleportd/neuraln"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/totemstech/neuraln","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totemstech%2Fneuraln","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totemstech%2Fneuraln/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totemstech%2Fneuraln/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totemstech%2Fneuraln/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totemstech","download_url":"https://codeload.github.com/totemstech/neuraln/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totemstech%2Fneuraln/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27790107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-18T02:00:09.725Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:00:22.771Z","updated_at":"2025-12-18T03:04:25.595Z","avatar_url":"https://github.com/totemstech.png","language":"C++","funding_links":[],"categories":["Javascript","JavaScript"],"sub_categories":["Tools","[Tools](#tools-1)","Speech Recognition"],"readme":"# NeuralN\n### Powerful Neural Network for Node.js\n\nNeuralN is a C++ Neural Network library for Node.js with multiple advantages\ncompared to existing solutions:\n  - Works with extra large datasets (\u003e1Go allowed by nodejs)\n  - Multi-Threaded training available.\n\n#### Large datasets\n\nWith Node.js and the V8, it is not possible to work with large datasets since\nthe maximum allowed memory is around 512MB for 32-bits machines and 1GB for\n64-bits machines. When you are working with datasets of several gigabytes, it\nquickly becomes difficult to train you network with all your data.\n\nNeuralN allows you to use datasets as big as your memory can contain.\n\n#### Multi-Threaded\n\nWorking with large datasets increases the performances of your final network,\nbut the learning phase can sometimes take up to several days or even weeks to\nobtain good results.\n\nWith the multi-threaded training method of NeuralN, you can significantly reduce\nthe duration of the learning phase, by training your network simultaneously on\ndifferent parts of your dataset. The results of each iteration are then combined.\n\n## Install\n\n```\nnpm install neuraln\n```\n\n## How it works\n\n```javascript\nvar NeuralN = require('neuraln');\n\n/* Create a neural network with 4 layers (2 hidden layers) */\nvar network = new NeuralN([ 1, 4, 3, 1 ]);\n\n/* Add points to the training set */\nfor(var i = -1; i \u003c 1; i+=0.1) {\n  network.train_set_add([ i ], [ Math.abs(Math.sin(i)) ]);\n}\n\n/* Train the network with one of the two available methods */\n/* monothread (blocking) vs multithread (non-blocking)     */\nnetwork.train({\n  target_error: 0.01,\n  iterations: 20000,\n\n  multithread: true,\n  /* Relevant only when multithread is true: */\n  step_size: 100,\n  threads: 4\n}, function(err) {\n\n});\n\n/* Run */\nvar result = network.run([ (Math.random() * 2) - 1 ]);\n\n/* Retrieve the network's string representation */\nvar string = network.to_string();\n\n/* Retrieve the network's state string */\nvar state = network.get_state();\n```\n\n## Instantiation \u0026 Methods\n\n```javascript\nvar network = new NeuralN(layers, momentum, learning_rate, bias);\nvar network = new NeuralN(network_string);\n```\n\nInstantiate a new network with the following parameters:\n- `layers` is an array representing the layers of the network\n- `momentum` is a number between 0 and 1. This parameter is optional and defaults to `0.3`\n- `learning_rate` is a number. This parameter is optional and defaults to `0.1`\n- `bias` is a number. This parameter is optional and defaults to `-1`\n\nOr\n\n- `network_string` a string from a previous network (using `to_string`)\n\n```javascript\nnetwork.train_set_add(input, output);\n```\n\nAdd a training data point with `input` and `output` being arrays of numbers.\n`input` and `output` must contain as many values as the number of neurons of the\nfirst and last layers\n\n```javascript\nnetwork.train([options, ]callback);\n```\n\nTrain the network with the training set until the `target_error` or the\n`max_iterations` has been reached. The `options` are optional parameters:\n- `target_error: 0.01`\n- `iterations: 20000`\n- `multithread` is a boolean, which defaults to `false`.\n- `step_size` represents the number of points of the training set to use by\nthread at each iteration. Default to `100` (only with `multithread: true`)\n- `threads` represents the number of threads to be used for the training.\nDefault to `4`  (only with `multithread: true`)\n- `callback(err)` is called once the training is done.\n\nAll these parameters are optional except for the `callback`\n\n```javascript\nnetwork.run(input)\n```\n\nRuns the given `input` throught the network and returns its `output`\n\n```javascript\nnetwork.to_string()\n```\n\nReturns a string representation of the network in order to save and reload it\nlater\n\n```javascript\nnetwork.get_state()\n```\n\nReturns a string representation of each neuron of the network. It allows you to\nunderstand which entrance neurons most impacted the final result.\n\n```javascript\nnetwork.to_json();\n\n// Example:\n{ layers: [ 1, 4, 3, 1 ],\n  momentum: 0.3,\n  learning_rate: 0.1,\n  bias: -1,\n  biases:\n   [ [],\n     [ -0.00000901958, -0.00000414136, 0.00000156238, -0.00000275219 ],\n     [ 0.000125352, 0.000145129, 0.000285706 ],\n     [ -0.00914877 ] ],\n  weights:\n   [ [],\n     [ [ 0.218714 ], [ 0.285424 ], [ 0.236087 ], [ 0.329174 ] ],\n     [ [ 0.0541952, -0.057953, -0.0293854, 0.030311 ],\n       [ -0.106412, -0.0125738, 0.0167244, -0.117874 ],\n       [ -0.0977025, -0.0275803, 0.0262269, 0.00674729 ] ],\n     [ [ -0.0480921, -0.0574143, -0.118449 ] ] ] }\n```\n\nReturns a json representation of the network. This is not recommended when the\nnetwork structure gets big.\n\n```javascript\nnetwork.get_state_json();\n\n// Example:\n{ layers: [ 1, 4, 3, 1 ],\n  values:\n   [ ,\n     [ [ 0.978927 ], [ 1.10844 ], [ 0.926947 ], [ 0.974797 ] ],\n     [ [ 2.39933, -2.49017, -5.58942, 3.32711 ],\n       [ -2.09446, -0.193907, 1.53176, -2.44019 ],\n       [ -2.62491, -0.0477072, 2.40908, -3.03165 ] ],\n     [ [ 1.38492, -0.294276, -0.362479 ] ] ] }\n```\n\nReturns a json representation of the network's state. This is not recommended\nwhen the network structure gets big.\n\n## Contact us\n\nFeel free to contact us at `hello@totems.co`\n\n## License\n\nDistributed under the MIT License.\n\nCopyright Teleportd Ltd. and other Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotemstech%2Fneuraln","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotemstech%2Fneuraln","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotemstech%2Fneuraln/lists"}