{"id":19659997,"url":"https://github.com/samyak2/numpytorch","last_synced_at":"2026-05-04T23:38:27.404Z","repository":{"id":117920382,"uuid":"356575503","full_name":"Samyak2/numpytorch","owner":"Samyak2","description":"Simple neural network implementation in numpy with a PyTorch-like API","archived":false,"fork":false,"pushed_at":"2021-04-12T11:28:16.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-05T13:47:51.837Z","etag":null,"topics":["deep-learning","neural-network","numpy","pytorch"],"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/Samyak2.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}},"created_at":"2021-04-10T12:29:12.000Z","updated_at":"2023-06-06T19:14:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6f66cb9-cfa7-42f7-978f-3ccd37a1918e","html_url":"https://github.com/Samyak2/numpytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Samyak2/numpytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2Fnumpytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2Fnumpytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2Fnumpytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2Fnumpytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samyak2","download_url":"https://codeload.github.com/Samyak2/numpytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2Fnumpytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32629339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["deep-learning","neural-network","numpy","pytorch"],"created_at":"2024-11-11T15:44:56.173Z","updated_at":"2026-05-04T23:38:27.384Z","avatar_url":"https://github.com/Samyak2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numpytorch\n\nSimple neural network implementation in numpy with a PyTorch-like API\n\n\u003csup\u003e\u003csub\u003eOriginally made for an assignment for the course \"Machine Intelligence\" at PES University. Although the commits are recent, most of the code was written during the course (Oct/Nov 2020) and moved from a different repo.\u003c/sub\u003e\u003c/sup\u003e\n\n## What can you do with it?\n\nThis is not meant to be used for serious workloads. You can use it as a learning tool though. For example, here is a list of things you could try learning from the code here:\n\n - Modular implementation of neural networks - each layer is a module with many trainable parameters. Refer [nn.py](./numpytorch/nn.py)\n     - This implementation is also very extensible - you can make your modules with various behaviour, such as [Dense](https://github.com/Samyak2/numpytorch/blob/49ee7bb6681d2e1d56802a1e23d304151bcdc512/numpytorch/nn.py#L59) (a fully connected layer) and even something meta like [Sequential](https://github.com/Samyak2/numpytorch/blob/49ee7bb6681d2e1d56802a1e23d304151bcdc512/numpytorch/nn.py#L111) (a chain of layers).\n     - Similarly, [activation functions](./numpytorch/activations.py), [loss functions](./numpytorch/losses.py) and [optimisers](./numpytorch/optim.py) are also modular and extensible.\n - Usage of Einstein summation operations in numpy (and in general). [Here's](https://stackoverflow.com/a/33641428/11199009) a nice reference for Einstein summation.\n - Type annotations in python - the codebase is almost completely [type-annotated](https://realpython.com/python-type-checking/). This makes the code a little easier to maintain and improves the editing experience significantly for users of the library. Although, [mypy](https://github.com/python/mypy) does report a few errors, most of the type annotations are correct (PRs are welcome to fix this).\n\n## Some possible future plans\n\nI don't plan to develop this further, but if you want to learn, you can try implementing the following (either in your own fork or send a PR!):\n\n - [ ] More activation functions. `numpytorch/activations.py` has a limited set of activation functions, there are many more you can add.\n - [ ] More loss functions. `numpytorch/losses.py` has only one loss function (binary cross-entropy).\n - [ ] More optimisers. `numpytorch/optim.py` has only one optimiser (Stochastic Gradient Descent, SGD) with support for L2 regularization and momentum. The [ADAM](https://arxiv.org/abs/1412.6980) optimiser would be a nice addition.\n - [ ] Automatic differentiation. Currently, backward passes (derivatives) have to be hand-coded into all the activation functions, layers, etc. Integrating some kind of automatic differentiation library (like [autograd](https://github.com/HIPS/autograd) or [autodidact](https://github.com/mattjj/autodidact)) would make this a lot less painful to customize. You could also try writing your own automatic differentiation library, that will be a fun project! ([ref](https://www.cs.toronto.edu/~rgrosse/courses/csc421_2019/readings/L06%20Automatic%20Differentiation.pdf))\n - [ ] Other fancy layers like convolution, recurrent cells, etc.\n\n## Acknowledgements\n\nTeam members [Aayush](https://github.com/NaikAayush/) and [Bhargav](https://github.com/bhargavsk1077/) for helping.\n\n## License\n\nnumpytorch is [MIT Licensed](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2%2Fnumpytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamyak2%2Fnumpytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2%2Fnumpytorch/lists"}