{"id":44630911,"url":"https://github.com/pratyushtiwary/toynn","last_synced_at":"2026-02-14T16:27:23.073Z","repository":{"id":179880009,"uuid":"663821782","full_name":"pratyushtiwary/toynn","owner":"pratyushtiwary","description":"A toy NN library in JS to play and learn NN concepts.","archived":false,"fork":false,"pushed_at":"2025-12-13T21:06:52.000Z","size":2947,"stargazers_count":3,"open_issues_count":32,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T16:35:52.130Z","etag":null,"topics":["javascript","neural-network","nn","toynn","typescript"],"latest_commit_sha":null,"homepage":"https://toynn.vercel.app/","language":"TypeScript","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/pratyushtiwary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-08T07:27:38.000Z","updated_at":"2025-11-22T15:49:27.000Z","dependencies_parsed_at":"2023-11-18T07:25:54.123Z","dependency_job_id":"c0911cc3-5628-4354-bdf4-4231ba27706a","html_url":"https://github.com/pratyushtiwary/toynn","commit_stats":null,"previous_names":["pratyushtiwary/toynn"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pratyushtiwary/toynn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratyushtiwary%2Ftoynn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratyushtiwary%2Ftoynn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratyushtiwary%2Ftoynn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratyushtiwary%2Ftoynn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratyushtiwary","download_url":"https://codeload.github.com/pratyushtiwary/toynn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratyushtiwary%2Ftoynn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29449369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["javascript","neural-network","nn","toynn","typescript"],"created_at":"2026-02-14T16:27:22.315Z","updated_at":"2026-02-14T16:27:23.056Z","avatar_url":"https://github.com/pratyushtiwary.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./logo.svg\" alt=\"toynn\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eA toy NN library for JS to play and learn NN concepts.\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/npm/dt/toynn\" alt=\"NPM Downloads\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/license/pratyushtiwary/toynn\" alt=\"License\"/\u003e\n\u003ca href=\"https://github.com/pratyushtiwary/toynn/actions/workflows/publish.yml\"\u003e\n\u003cimg src=\"https://github.com/pratyushtiwary/toynn/actions/workflows/publish.yml/badge.svg\" alt=\"Publish to NPM Status Badge\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/pratyushtiwary/toynn\" \u003e\n\u003cimg src=\"https://codecov.io/gh/pratyushtiwary/toynn/branch/main/graph/badge.svg?token=J67V3JHQPG\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eContribution is much appreciated, if you feel like something is not right or you've found some bug feel free to raise an issue or create a PR\u003c/b\u003e\n\u003c/p\u003e\n\n## Requirements\n\n[NodeJS](https://nodejs.org/) v18.0.0 or higher must be installed to use `toynn`.\n\n## Installation\n\n| **Source** | **Info**            |\n| ---------- | ------------------- |\n| npm        | `npm install toynn` |\n| yarn       | `yarn add toynn`    |\n\n## Usage\n\n```js\nimport toynn from 'toynn';\n\nconst X = [\n    new toynn.NArray([0, 0]).reshape(1, 2),\n    new toynn.NArray([0, 1]).reshape(1, 2),\n    new toynn.NArray([1, 0]).reshape(1, 2),\n    new toynn.NArray([1, 1]).reshape(1, 2),\n];\n\nconst y = [\n    new toynn.NArray([0]),\n    new toynn.NArray([0]),\n    new toynn.NArray([0]),\n    new toynn.NArray([1]),\n];\n\nconst model = new toynn.NN('and');\n\nconst layer1 = new toynn.Layer(2, 3);\nlayer1.use(toynn.functions.linear);\nconst layer2 = new toynn.Layer(3, 1);\nlayer2.use(toynn.functions.sigmoid);\n\nmodel.add(layer1);\nmodel.add(layer2);\n\nmodel.train({\n    x: X,\n    y,\n    epochs: 500,\n    alpha: 0.001,\n    loss: toynn.errors.MSE,\n    verbose: true,\n});\n\nlet newData = new toynn.NArray([1, 0]).reshape(1, 2);\n// make prediction\nconsole.log(model.forward(newData).flatten());\n```\n\n**Note: The above code only supports v2.0.0 or above**\n\n**You can use the library with typescript also. The code remains the same.**\n\n## Docs\n\nDocs can be found [here](https://toynn.vercel.app/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratyushtiwary%2Ftoynn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratyushtiwary%2Ftoynn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratyushtiwary%2Ftoynn/lists"}