{"id":23429888,"url":"https://github.com/chuvalniy/torchy","last_synced_at":"2026-05-01T19:34:26.577Z","repository":{"id":184354892,"uuid":"669978074","full_name":"chuvalniy/Torchy","owner":"chuvalniy","description":"Built from scratch neural network library using only NumPy","archived":false,"fork":false,"pushed_at":"2025-10-19T14:04:02.000Z","size":553,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T06:47:32.141Z","etag":null,"topics":["backpropogation","from-scratch","gradient","math","neural-net","numpy","pytorch-like"],"latest_commit_sha":null,"homepage":"","language":"Python","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/chuvalniy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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-24T02:53:37.000Z","updated_at":"2024-05-23T21:46:12.000Z","dependencies_parsed_at":"2023-07-28T04:39:00.478Z","dependency_job_id":"56538a2a-36f0-420d-914a-b26336558dfd","html_url":"https://github.com/chuvalniy/Torchy","commit_stats":null,"previous_names":["chuvalik/brainfromscratch","chuvalik/torchy","chuvalniy/torchy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chuvalniy/Torchy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuvalniy%2FTorchy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuvalniy%2FTorchy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuvalniy%2FTorchy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuvalniy%2FTorchy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuvalniy","download_url":"https://codeload.github.com/chuvalniy/Torchy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuvalniy%2FTorchy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32510808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["backpropogation","from-scratch","gradient","math","neural-net","numpy","pytorch-like"],"created_at":"2024-12-23T08:13:38.660Z","updated_at":"2026-05-01T19:34:26.550Z","avatar_url":"https://github.com/chuvalniy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Python Version](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-360/)\n[![PyPI Version](https://img.shields.io/pypi/v/torchy-nn.svg)](https://pypi.org/project/torchy-nn/)\n![Status](https://img.shields.io/badge/status-alpha-orange.svg)\n\n![изображение](https://github.com/chuvalniy/Torchy/assets/85331232/e0ab8cfe-4e12-42f9-b90e-37fb93f8ffd0)\n\n\n## Overview\nTorchy is a neural network framework implemented only using NumPy and based on PyTorch API but with manual backpropogation calculations. The main idea was to build a neural network from scratch for educational purposes.\n\n## Installation\n```python\npip install torchy-nn\n```\n## Getting started\nI suggest you to take a look at [currently implemented stuff](https://github.com/chuvalniy/Torchy/blob/main/docs/Implemented.md) to be familiar with current possibilities for building neural network models with Torchy. Also I've created [package structure](https://github.com/chuvalniy/Torchy/blob/main/docs/PackageStructure.md) in case if you stuck where to get specific layers.\n\n## Example usage\nFirst we can define our model using Torchy with its PyTorch-like API\n\n```python\nimport torchy.nn as nn  # Same as torch.nn\n\n# Define 2-layer wtth 100 neurons hidden layer.\nmodel = nn.Sequential(\n    nn.Linear(n_input=10, n_output=100),\n    nn.BatchNorm1d(n_output=100),\n    nn.ReLU(),\n    nn.Linear(n_input=100, n_output=2)\n)\n```\n\nNext step is to create instances of optimizer and criterion for loss function and scheduler for fun\n\n```python\nimport torchy.optimizers as optim\n\noptimizer = optim.SGD(model.params(), lr=1e-3)\ncriterion = nn.CrossEntropyLoss()\nscheduler = optim.StepLR(optimizer, step_size=10)\n```\n\nI won't cover whole training process like loops and stuff, just show you main differences while training\n\n```python\n...\npredictions = model(X)  # Nothing changed\n\nloss, grad = criterion(predictions, y)  # Now return tuple of (loss, grad) instead of only loss \n\noptimizer.zero_grad()\nmodel.backward(grad)  # Call backward on model object and pass gradient from loss as argument\noptimizer.forward_step()\n```\n\n## Testing\nEvery neural network module is provided with unit test that verify correctness of forward and backward passes.\n\nExecute the following command in your project directory to run the tests.\n```python\npytest -v\n```\n## Demonstration\nThe [demo notebook](https://github.com/chuvalniy/Torchy/blob/main/demos/torchy-demo-1.ipynb) showcases what Torchy currently can do.\n\n## Roadmap\nIt seems to me that I've completed all the modules that I wanted to code, but there are still some unfinished points, here are some of them:\n- Dataset, DataLoader \u0026 Sampler;\n- Transformer;\n- Fix regularization;\n- Autograd (as new git branch)\n\n## Resources\nThe opportunity to create such a project was given to me thanks to these people\n\n- [PyTorch](https://github.com/pytorch/pytorch)\n- [CS231n - 2016](https://youtube.com/playlist?list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC)\n- [Deep Learning на пальцах - 2019](https://youtube.com/playlist?list=PL5FkQ0AF9O_o2Eb5Qn8pwCDg7TniyV1Wb)\n- [Neural Networks: Zero to Hero](https://youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ)\n\n\n## License\n[MIT License](https://github.com/chuvalniy/Torchy/blob/main/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuvalniy%2Ftorchy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuvalniy%2Ftorchy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuvalniy%2Ftorchy/lists"}