{"id":17736611,"url":"https://github.com/shivendrra/axgrad","last_synced_at":"2026-05-08T03:40:14.413Z","repository":{"id":233089226,"uuid":"785984619","full_name":"shivendrra/axgrad","owner":"shivendrra","description":"lightweight tensor library that contains it's own auto-diff engine like pytorch","archived":false,"fork":false,"pushed_at":"2025-02-02T07:41:21.000Z","size":1145,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T08:25:05.878Z","etag":null,"topics":["autograd","cuda","pytorch","scratch-implementation","tinygrad"],"latest_commit_sha":null,"homepage":"","language":"Python","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/shivendrra.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T04:41:38.000Z","updated_at":"2024-12-30T18:02:39.000Z","dependencies_parsed_at":"2024-12-09T17:33:23.851Z","dependency_job_id":"8b30e7f7-ac21-4a73-a734-2535b48b3d89","html_url":"https://github.com/shivendrra/axgrad","commit_stats":null,"previous_names":["shivendrra/axgrad"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivendrra%2Faxgrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivendrra%2Faxgrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivendrra%2Faxgrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivendrra%2Faxgrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivendrra","download_url":"https://codeload.github.com/shivendrra/axgrad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523847,"owners_count":20791444,"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":["autograd","cuda","pytorch","scratch-implementation","tinygrad"],"created_at":"2024-10-26T00:23:44.538Z","updated_at":"2026-05-08T03:40:14.397Z","avatar_url":"https://github.com/shivendrra.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# axgrad\n![axon.png](https://github.com/shivendrra/axgrad/blob/main/axon.png)\n\n## Overview\nIt contains a framework similar to Numpy which allows to do basic matrix operations like element-wise add/mul + matrix multiplication + broadcasting. Also building pytorch like auto-differentiation engine: axgrad\n\n## Features\nIt has basic building blocks required to build a neural network:\n1. Basic tensor ops framework that could easily so matrix add/mul (element-wise), transpose, broadcasting, matmul, etc.\n2. A gradient engine that could compute and update gradients, automatically, much like micrograd, but on a tensor level ~ autograd like (work in progress!).\n3. Optimizer \u0026 loss computation blocks to compute and optimize (work in progress!).\ni'll be adding more things in future...\n\n## Usage\nThis shows basic usage of `axgrad.engine` \u0026 few of the `axon`'s modules to preform tensor operations and build a sample neural network\n\nanyway, prefer documentation for detailed usage guide:\n1. [Usage.md](https://github.com/shivendrra/axgrad/blob/main/docs/User.md): User documentation for AxGrad\n\u003c!-- 2. [axgrad.doc](https://github.com/shivendrra/axgrad/blob/main/docs/axgradDoc.md): for building neural network from axon library (incomplete for now) --\u003e\n\n## Creating a MLP\n\nTo create a multi-layer perceptron in ``axgrad``, you'll just need to follow the steps you followed in PyTorch. Very basic, initiallize two linear layers \u0026 a basic activation layer.\n\n```python\nimport axgrad\nimport axgrad.nn as nn\n\nclass MLP(nn.Module):\n  def __init__(self, _in, _hid, _out, bias=False) -\u003e None:\n    super().__init__()\n    self.layer1 = nn.Linear(_in, _hid, bias)\n    self.gelu = nn.GELU()\n    self.layer2 = nn.Linear(_hid, _out, bias)\n  \n  def forward(self, x):\n    out = self.layer1(x)\n    out = self.gelu(out)\n    out = self.layer2(out)\n    return out\n```\n\nrefer to this [Example](https://github.com/shivendrra/axgrad/blob/main/examples/mlp.py) for detailed info on making mlp\n\nbtw, here's the outputs i got from my simple implementation, that ran till 5kiters:\n\n![result](https://github.com/shivendrra/axgrad/blob/main/examples/mlp.png)\n\n## Contribution\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\nPlease make sure to update tests as appropriate. But it's still a work in progress.\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivendrra%2Faxgrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivendrra%2Faxgrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivendrra%2Faxgrad/lists"}