{"id":31756534,"url":"https://github.com/sql-hkr/syna","last_synced_at":"2026-05-14T20:07:23.984Z","repository":{"id":318498019,"uuid":"1070807476","full_name":"sql-hkr/syna","owner":"sql-hkr","description":"Syna is a lightweight machine learning framework inspired by DeZero.","archived":false,"fork":false,"pushed_at":"2025-10-26T01:19:06.000Z","size":233,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T16:44:01.919Z","etag":null,"topics":["framework","machine-learning","reinforcement-learning"],"latest_commit_sha":null,"homepage":"https://sql-hkr.github.io/syna/","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/sql-hkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2025-10-06T13:17:50.000Z","updated_at":"2026-01-14T19:41:16.000Z","dependencies_parsed_at":"2025-10-26T03:13:03.697Z","dependency_job_id":"7fec5e8a-8965-4cd2-a8be-1f2c54be9e83","html_url":"https://github.com/sql-hkr/syna","commit_stats":null,"previous_names":["sql-hkr/syna"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sql-hkr/syna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sql-hkr%2Fsyna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sql-hkr%2Fsyna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sql-hkr%2Fsyna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sql-hkr%2Fsyna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sql-hkr","download_url":"https://codeload.github.com/sql-hkr/syna/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sql-hkr%2Fsyna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33041269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["framework","machine-learning","reinforcement-learning"],"created_at":"2025-10-09T19:19:08.390Z","updated_at":"2026-05-14T20:07:23.977Z","avatar_url":"https://github.com/sql-hkr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Syna\n\n![PyPI - Version](https://img.shields.io/pypi/v/syna)\n![GitHub License](https://img.shields.io/github/license/sql-hkr/syna)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syna)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/sql-hkr/syna/ci.yml?label=CI)\n\n\nSyna is a lightweight machine learning framework inspired by [DeZero](https://github.com/oreilly-japan/deep-learning-from-scratch-3). Built from scratch using only NumPy, it follows a define-by-run (dynamic computation graph) approach and includes a basic reinforcement learning framework.\n\nUnlike most frameworks that implement reinforcement learning as a separate library, Syna provides everything in a single library.\n\nDesigned for beginners and researchers, Syna helps you learn the fundamentals of machine learning and the inner workings of frameworks like [PyTorch](https://github.com/pytorch/pytorch). Performance is not the focus, and GPU support is intentionally omitted to keep the code simple and easy to understand.\n\n\n## Installation\n\nGet the Syna Source\n\n```bash\ngit clone https://github.com/sql-hkr/syna.git\ncd syna\nuv venv\nsource .venv/bin/activate\nuv sync\n```\n\nOr, from [PyPI](https://pypi.org/project/syna/):\n\n```bash\nuv add syna\n```\n\n\u003e [!IMPORTANT]\n\u003e To visualize the computation graph, you need to install [Graphviz](https://graphviz.org).\n\u003e ```bash\n\u003e brew install graphviz # macOS\n\u003e sudo apt install graphviz # Linux\n\u003e ```\n\n## Getting started\n### Computation Graph\n\nVisualize the computation graph for the fifth derivative of tanh(x) with respect to x.\n\n```python\nimport syna\nimport syna.functions as F\nfrom syna import utils\n\nx = syna.tensor(1.0)\ny = F.tanh(x)\nx.name = \"x\"\ny.name = \"y\"\ny.backward(create_graph=True)\n\niters = 4\n\nfor i in range(iters):\n    gx = x.grad\n    x.cleargrad()\n    gx.backward(create_graph=True)\n\ngx = x.grad\ngx.name = \"gx\" + str(iters + 1)\nutils.viz.plot_dot_graph(gx, verbose=False, to_file=\"tanh.svg\")\n```\n\nThe output graph is shown below.\n\n![](/docs/_static/graph/tanh.svg)\n\n### RL (Deep Q-Network; DQN)\n\nSolve CartPole-v1 using the DQN algorithm.\n\n```python\nfrom syna.algo.dqn import DQNAgent\nfrom syna.utils.rl import Trainer\n\ntrainer = Trainer(\n    env_name=\"CartPole-v1\",\n    num_episodes=300,\n    agent=DQNAgent(\n        lr=3e-4,\n    ),\n)\ntrainer.train()\n```\n\n## API Reference\n- [syna package](https://sql-hkr.github.io/syna/api/syna.html)\n\n## License\n\nSyna is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsql-hkr%2Fsyna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsql-hkr%2Fsyna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsql-hkr%2Fsyna/lists"}