{"id":29895551,"url":"https://github.com/raphaelsenn/mugrad","last_synced_at":"2025-08-01T07:20:56.103Z","repository":{"id":300596596,"uuid":"1005076287","full_name":"raphaelsenn/mugrad","owner":"raphaelsenn","description":"An autograd engine with PyTorch-like API - something between Karpathy's micrograd and George Hotz's tinygrad.","archived":false,"fork":false,"pushed_at":"2025-06-22T15:46:58.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T16:36:49.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/raphaelsenn.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}},"created_at":"2025-06-19T16:17:59.000Z","updated_at":"2025-06-22T15:47:01.000Z","dependencies_parsed_at":"2025-06-22T16:48:18.341Z","dependency_job_id":null,"html_url":"https://github.com/raphaelsenn/mugrad","commit_stats":null,"previous_names":["raphaelsenn/mugrad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/mugrad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fmugrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fmugrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fmugrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fmugrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/mugrad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fmugrad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268185548,"owners_count":24209387,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2025-08-01T07:20:52.909Z","updated_at":"2025-08-01T07:20:56.064Z","avatar_url":"https://github.com/raphaelsenn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mugrad\nYes, yet another autograd engine with PyTorch-like API... It is called mugrad!\n\n**Whats the purpose of mugrad?**\n* Just to teach myself (and maybe/hopefully others) how something like PyTorch works (or kind of works.. pytorch is much more complicated than mugrad :D).\n\n\n## Usage\n\n### Creating Neural Networks with mugrad\n\n```python\nfrom mugrad.mugrad import Tensor\nfrom mugrad.nn import Module, Linear\n\n\nclass MuNeuralNet(Module):\n    def __init__(self):\n        self.fc1 = Linear(784, 128)\n        self.fc2 = Linear(128, 10)\n\n    def forward(self, x):\n        x = self.fc1(x)\n        x = x.relu() \n        x = self.fc2(x)\n        x = x.relu()\n        return x\n\nmodel = MuNeuralNet()\n```\n\n\n```python\nfrom mugrad.mugrad import Tensor\nfrom mugrad.nn import Module, Linear, ReLU, Sequential\n\n\nmodel = Sequential([\n    Linear(784, 128),\n    ReLU(),\n    Linear(128, 10),\n    ReLU()\n])\n```\n\n\n### Training Neural Networks with mugrad\n\n```python\nimport mugrad as mu\nfrom mugrad.nn import CrossEntropyLoss\n\n\noptimizer = mu.optim.SGD(params=model.parameteres(), lr=0.001)\ncriterion = CrossEntropyLoss()\n\nfor epoch in range(epochs):\n    optimizer.zero_grad()\n    y_pred = model.forward(X_train)\n    loss = criterion(y_pred, y_test)\n    loss.backward()\n    optimizer.step()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fmugrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fmugrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fmugrad/lists"}