{"id":25872984,"url":"https://github.com/marcosalvalaggio/kiwigrad","last_synced_at":"2025-08-22T05:38:22.522Z","repository":{"id":119734055,"uuid":"609542258","full_name":"marcosalvalaggio/kiwigrad","owner":"marcosalvalaggio","description":"Mini deep learning framework written in Python C-API for Speed","archived":false,"fork":false,"pushed_at":"2023-07-05T10:42:29.000Z","size":2707,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T00:33:14.463Z","etag":null,"topics":["c","cpython-api","cpython-extensions","deep-learning","pypi-package","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"C","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/marcosalvalaggio.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}},"created_at":"2023-03-04T13:49:43.000Z","updated_at":"2023-11-30T08:45:13.000Z","dependencies_parsed_at":"2023-03-13T12:39:09.830Z","dependency_job_id":null,"html_url":"https://github.com/marcosalvalaggio/kiwigrad","commit_stats":null,"previous_names":["marcosalvalaggio/kiwigrad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcosalvalaggio/kiwigrad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosalvalaggio%2Fkiwigrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosalvalaggio%2Fkiwigrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosalvalaggio%2Fkiwigrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosalvalaggio%2Fkiwigrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcosalvalaggio","download_url":"https://codeload.github.com/marcosalvalaggio/kiwigrad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosalvalaggio%2Fkiwigrad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271592421,"owners_count":24786586,"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-22T02:00:08.480Z","response_time":65,"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":["c","cpython-api","cpython-extensions","deep-learning","pypi-package","python","pytorch"],"created_at":"2025-03-02T08:29:12.090Z","updated_at":"2025-08-22T05:38:22.477Z","avatar_url":"https://github.com/marcosalvalaggio.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Kiwigrad\n\n\u003ch1 align=\"center\"\u003e\n\u003cimg src=\"logo.png\" width=\"200\"\u003e\n\u003c/h1\u003e\u003cbr\u003e\n\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![stability-wip](https://img.shields.io/badge/stability-wip-lightgrey.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#work-in-progress)\n\n\n*Despite lacking the ability to fly through the skies like **PyTorch** and **TensorFlow**, the Kiwigrad is still a formidable bird that is teeming with untapped potential waiting to be uncovered.* :wink:\n\n- [Kiwigrad](#kiwigrad)\n- [Install](#install)\n- [Functionalities](#functionalities)\n  - [Examples](#examples)\n- [Running test](#running-test)\n\nKiwigrad? yes, it is another version of [micrograd](https://github.com/karpathy/micrograd) that was created just for fun and experimentation.\n\n## Install \n\nTo install the current release,\n\n```console\npip install kiwigrad==0.28\n```\n\n## Functionalities \n\nKiwigrad is a modified version of the [micrograd](https://github.com/karpathy/micrograd) and the [minigrad](https://github.com/goktug97/minigrad) packages with additional features. The main features added to Kiwigrad are:\n\n* Training is faster due to the C implementation of the Value object.\n* Tracing functionalities like the original [micrograd](https://github.com/karpathy/micrograd) package were added. An example of this can be seen in the [ops](examples/ops.ipynb) notebook.\n* Methods for saving and loading the weights of a trained model.\n* Support for RNN(1) feedforward neural networks.\n\n### Examples\n\n* In the [examples](examples/) folder, you can find examples of models trained using the Kiwigrad library.\n* A declaration example of an MLP net using Kiwigrad:\n  \n```python \nfrom kiwigrad import MLP, Layer\n\nclass PotNet(MLP):\n    def __init__(self):\n        layers = [\n            Layer(nin=2, nout=16, bias=True, activation=\"relu\"),\n            Layer(nin=16, nout=16, bias=True, activation=\"relu\"),\n            Layer(nin=16, nout=1, bias=True, activation=\"linear\")\n        ]\n        super().__init__(layers=layers)\n\nmodel = PotNet()\n```\n* Kiwigrad like [micrograd](https://github.com/karpathy/micrograd) comes with support for a number of possible operations:\n\n```python \nfrom kiwigrad import Value, draw_dot\n\na = Value(-4.0)\nb = Value(2.0)\nc = a + b\nd = a * b + b**3\nc += c + Value(1.)\nc += Value(1.) + c + (-a)\nd += d * Value(2) + (b + a).relu()\nd += Value(3.) * d + (b - a).relu()\ne = c - d\nf = e**2\ng = f / Value(2.0)\ng += Value(10.0) / f\nprint(f'{g.data:.4f}') # prints 24.7041, the outcome of this forward pass\ng.backward()\nprint(f'{a.grad:.4f}') # prints 138.8338, i.e. the numerical value of dg/da\nprint(f'{b.grad:.4f}') # prints 645.5773, i.e. the numerical value of dg/db\n\ndraw_dot(g)\n```\n\n## Running test\n\n```console\ncd test \npytest .\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosalvalaggio%2Fkiwigrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcosalvalaggio%2Fkiwigrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosalvalaggio%2Fkiwigrad/lists"}