{"id":13670590,"url":"https://github.com/matiasvlevi/Dann","last_synced_at":"2025-04-27T13:32:29.905Z","repository":{"id":39748134,"uuid":"292914074","full_name":"matiasvlevi/Dann","owner":"matiasvlevi","description":"Deep Neural Network Library for JavaScript.","archived":true,"fork":false,"pushed_at":"2025-02-06T20:34:56.000Z","size":3760,"stargazers_count":425,"open_issues_count":7,"forks_count":23,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-08T08:11:12.549Z","etag":null,"topics":["dann","dannjs","deep-learning","deep-neural-networks","javascript","js","machine-learning","neural-network","nodejs"],"latest_commit_sha":null,"homepage":"https://dannjs.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matiasvlevi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"dannjs"}},"created_at":"2020-09-04T17:59:49.000Z","updated_at":"2025-02-06T20:35:16.000Z","dependencies_parsed_at":"2023-01-21T02:48:27.420Z","dependency_job_id":null,"html_url":"https://github.com/matiasvlevi/Dann","commit_stats":null,"previous_names":[],"tags_count":221,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasvlevi%2FDann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasvlevi%2FDann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasvlevi%2FDann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasvlevi%2FDann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matiasvlevi","download_url":"https://codeload.github.com/matiasvlevi/Dann/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251145642,"owners_count":21543075,"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","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":["dann","dannjs","deep-learning","deep-neural-networks","javascript","js","machine-learning","neural-network","nodejs"],"created_at":"2024-08-02T09:00:45.860Z","updated_at":"2025-04-27T13:32:24.879Z","avatar_url":"https://github.com/matiasvlevi.png","language":"JavaScript","funding_links":["https://patreon.com/dannjs"],"categories":["JavaScript"],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://dannjs.org/\"\u003e\n    \u003cimg src=\"https://dannjs.org/transparentlogo.png\" alt=\"Dannjs\" height=\"150\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/dannjs\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/dannjs?style=flat\u0026color=f69e7b\u0026labelColor=383e56\u0026label=version\" alt=\"versionNpmStat\"/\u003e\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/repo-size/matiasvlevi/Dann?style=flat\u0026label=size\u0026color=f69e7b\u0026labelColor=383e56\" alt=\"repoSize\"/\u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/dannjs\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/dy/dannjs?style=flat\u0026color=f69e7b\u0026labelColor=383e56\u0026label=npm\" alt=\"downloadNpmStat\"/\u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/dannjs\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/jsdelivr/gh/hy/matiasvlevi/dann?label=cdn\u0026style=flat\u0026color=f69e7b\u0026labelColor=383e56\" alt=\"downloadNpmStat\"/\u003e\u003c/a\u003e \u003ca href=\"https://raw.githubusercontent.com/matiasvlevi/Dann/master/LICENSE\" target=\"_blank\"\u003e\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/matiasvlevi/dann?color=f69e7b\u0026labelColor=383e56\" alt=\"Liscence\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003ch4 align=\"center\"\u003eDeep Neural Network Library for Javascript\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n    Train a neural network with your data \u0026 save its trained state!\n\n\n  \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#Demo\"\u003eDemo\u003c/a\u003e •\n  \u003ca href=\"#Installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"https://dannjs.org/docs/classes/Dann\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"https://github.com/matiasvlevi/Dann/blob/master/CONTRIBUTING.md\"\u003eContribute\u003c/a\u003e •\n  \u003ca href=\"https://discord.gg/yeAqHsGdtU\"\u003eDiscord\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n\n## Installation\n### CDN :\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/matiasvlevi/dann@v2.4.1e/build/dann.min.js\"\u003e\u003c/script\u003e\n```\n### Node :\n```\nnpm i dannjs\n```\n[dannjs on npmjs.com](https://www.npmjs.com/package/dannjs)\n\u003cbr/\u003e\u003cbr/\u003e\n\n## Getting started\n\n\n### Require package\n\nComponents from the library can be imported like this\n```js\nconst { Dann } = require('dannjs');\n ```\n\n\u003cbr/\u003e\n\n### Basic model construction\nSetting up a small (4,6,6,2) neural network.\n```js\nconst nn = new Dann(4, 2);\nnn.addHiddenLayer(6, 'leakyReLU');\nnn.addHiddenLayer(6, 'leakyReLU');\nnn.outputActivation('tanH');\nnn.makeWeights();\nnn.lr = 0.0001;\nnn.log({details:true});\n```\n\u003cbr/\u003e\n\n\n### Train by backpropagation\nTraining with a dataset.\n```js\n//XOR 2 inputs, 1 output\nconst dataset = [\n    {\n        input: [0, 0],\n        output: [0]\n    },\n    {\n        input: [1, 0],\n        output: [1]\n    },\n    {\n        input: [0, 1],\n        output: [1]\n    },\n    {\n        input: [1, 1],\n        output: [0]\n    }\n];\n\n//train 1 epoch\nfor (data of dataset) {\n    nn.backpropagate(data.input, data.output);\n    console.log(nn.loss);\n}\n```\n\n\u003cbr/\u003e\n\n### Train by mutation\nFor neuroevolution simulations. Works best with small models \u0026 large population size.\n```js\nconst populationSize = 1000;\nlet newGeneration = [];\n\nfor (let i = 0; i \u003c populationSize; i++) {\n\n    // parentNN would be the best nn from past generation.\n    const childNN = parentNN;\n    childNN.mutateRandom(0.01, 0.65);\n\n    newGeneration.push(childNN);\n}\n```\n\n\u003cbr/\u003e\n\n### Standalone function\nConvert a Neural Network to a JS function that can output predictions without the library.\n```js\nlet strfunc = nn.toFunction();\nconsole.log(strfunc);\n```\n\n\u003cbr/\u003e\n\n### Save JSON\n```js\nlet json = nn.toJSON();\nconsole.log(json);\n```\n\n\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n### Demo:\n[AI predicts San-francisco Housing prices.](https://dannjs.org/livedemo.html) \u003cbr/\u003e\nmore examples \u0026 demos [here](https://dannjs.org/#exm)\n\u003cbr/\u003e\n\n\n### Online editor:\n\n[https://dannjs.org/sandbox](https://dannjs.org/sandbox)\n\n\u003cbr/\u003e\n\n### Socials\n\n\u003cdiv\u003e\n\u003ca href=\"https://twitter.com/DannjsAi\" target=\"_blank\"\u003e\n\u003cimg src=https://raw.githubusercontent.com/matiasvlevi/SocialMediaIcons/main/twitter.svg alt=twitter width=40px /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://patreon.com/dannjs\" target=\"_blank\"\u003e\n\u003cimg src=https://raw.githubusercontent.com/matiasvlevi/SocialMediaIcons/main/patreon.svg alt=twitter width=40px /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://instagram.com/dannj.s\" target=\"_blank\"\u003e\n\u003cimg src=https://raw.githubusercontent.com/matiasvlevi/SocialMediaIcons/main/instagram.svg alt=twitter width=40px /\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n### Graph Dann models with this library\n\n[Dann-p5](https://github.com/matiasvlevi/Dann-p5)\n\n\u003cbr/\u003e\n\n\n### Stickers\n[Get Dannjs stickers!](https://www.redbubble.com/people/Dannjs/shop)\n\n\n\u003cbr/\u003e\u003cbr/\u003e\n \n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/matias-vazquez-levi-846a991a6/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/50473168?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMatias Vazquez-Levi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=matiasvlevi\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=matiasvlevi\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=matiasvlevi\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#tutorial-matiasvlevi\" title=\"Tutorials\"\u003e✅\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/FrancescoXX\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/18360871?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFrancesco Ciulla\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#talk-FrancescoXX\" title=\"Talks\"\u003e📢\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Labnann\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/55809005?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLabnan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/issues?q=author%3ALabnann\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=Labnann\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=Labnann\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/SharkAce\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/85720638?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003esharkAce\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=SharkAce\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/shirsho1106\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/60136067?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHasnain Iqbal\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=shirsho1106\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=shirsho1106\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ramos-papadopoulos\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/82990932?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEL Ramos\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/issues?q=author%3Aramos-papadopoulos\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=ramos-papadopoulos\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=ramos-papadopoulos\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/viabhinav\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/48197061?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eviabhinav\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#tutorial-viabhinav\" title=\"Tutorials\"\u003e✅\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/and1can\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7698330?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eand1can\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=and1can\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/matiasvlevi/Dann/commits?author=and1can\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\u003cbr/\u003e\n\nAny contributions are welcome! See [CONTRIBUTING.md](https://github.com/matiasvlevi/Dann/blob/master/CONTRIBUTING.md).\n\n\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n## License\n\nMIT\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatiasvlevi%2FDann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatiasvlevi%2FDann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatiasvlevi%2FDann/lists"}