{"id":20634060,"url":"https://github.com/hokim98/n3","last_synced_at":"2026-04-18T18:31:58.524Z","repository":{"id":55620131,"uuid":"292596986","full_name":"HoKim98/n3","owner":"HoKim98","description":"Neural Network Notation written in Rust","archived":false,"fork":false,"pushed_at":"2021-09-09T06:07:12.000Z","size":808,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T05:15:03.782Z","etag":null,"topics":["deep-learning","framework","productivity","python"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/HoKim98.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}},"created_at":"2020-09-03T14:42:03.000Z","updated_at":"2022-01-18T13:18:57.000Z","dependencies_parsed_at":"2022-08-15T04:40:29.287Z","dependency_job_id":null,"html_url":"https://github.com/HoKim98/n3","commit_stats":null,"previous_names":["kerryeon/n3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HoKim98/n3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoKim98%2Fn3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoKim98%2Fn3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoKim98%2Fn3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoKim98%2Fn3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoKim98","download_url":"https://codeload.github.com/HoKim98/n3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoKim98%2Fn3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31979880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"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","framework","productivity","python"],"created_at":"2024-11-16T14:23:39.840Z","updated_at":"2026-04-18T18:31:58.503Z","avatar_url":"https://github.com/HoKim98.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/kerryeon/n3/blob/master/assets/logo.png\"\u003e\n\u003c/div\u003e\n\n# N3: Neural Network Notation\n\n[![Rust](https://github.com/kerryeon/n3/workflows/Rust/badge.svg)](https://travis-ci.com/kerryeon/n3)\n\nThis project is WIP. Please be aware of using it.\n\n```\nnode LeNet5:\n    let K: kernel size = int 5\n\n    let C: input channels = dim\n    let W: width = dim\n    let H: height = dim\n\n    with Conv2D:\n        set kernel size = K\n        set padding = K / 2\n        set stride = 2\n\n    node MyConv:\n        1. Conv2D\n        2. Relu\n\n    0. Input                    =  C, W  , H\n    1. MyConv                   = 32, W/2, H/2\n    2. MyConv                   = 64, W/4, H/4\n    3. ToLinear\n    4. Linear + Relu + Dropout  = 1024\n    5. Linear                   = 10\n```\n\n# Quick Start\n\n```bash\n# install dependencies (apt)\nsudo apt update\nsudo apt install -y \\\n    gcc git\n    sqlite3 libsqlite3-dev\n\n# create an conda environment (can vary on your settings)\nconda create -n n3 -c pytorch -c nvidia \\\n    python=3 pip \\\n    pytorch torchvision torchaudio cudatoolkit=11.1 \\\n    tqdm\nconda install -n n3 -c conda-forge \\\n    inflection tensorboard tensorboardx\nconda activate n3\n\n# build\ncargo b --all\n\n# set environment variables\nexport N3_SOURCE_ROOT=$PWD/n3-torch/ffi/python/n3/\nexport PYTHONPATH=$PYTHONPATH:$N3_SOURCE_ROOT/../\nexport PATH=$PATH:$PWD/target/debug/\n\n# set environment variables (by manual)\nexport PATH=$PATH:$(dirname $(which python)/../bin/)\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(dirname $(which python)/../lib/)\n\n# set environment variables (can vary on your settings)\nexport N3_MACHINES=cuda\n\n# spawn a daemon (in the seperated tty)\nn3-torchd\n\n# train a model (in the seperated tty)\nn3 train image_classification --model LeNet5 --data MNIST \\\n    --epoch 1 --batch_size 50\n\n# monitor the progress (in the seperated tty)\nn3 monitor\n```\n\n# Usage\n\n## Server\n\n```bash\n$ sudo systemctl start n3-torchd\n```\n\n## Client\n\n### Training\n\n```bash\n$ n3 train image_classification --model LeNet5 --data MNIST --machines cuda\n```\n\n### Evaluating\n\n```bash\n$ n3 eval image_classification --model LeNet5 --data MNIST --machines cuda\n```\n\n### Publishing\n\n```bash\n$ n3 publish image_classification --model LeNet5 --target android:java\n```\n\n* android: java, flutter\n* ios: flutter\n* universal: c++, python\n\n### Monitoring using Tensorboard\n\n```bash\n$ n3 monitor # or, browse http://localhost::xxxx/\n```\n\n### Distributed Training\n\n```bash\n$ n3 train image_classification --model LeNet5 --data MNIST --machines w:180:cuda:0 w:192.168.0.181 cpu\n```\n\n* \"w:180:cuda:0\": the \"cuda:0\" machine in \"xxx.xxx.xxx.180\" (local)\n* \"w:192.168.0.181\": automatically choose machines in \"192.168.0.181\"\n* These can be defined as environment variables (N3_MACHINES)\n\n## Docker\n\n```bash\n$ docker build --tag n3:1.0 .\n$ docker run -it --rm n3:1.0 bash -c \"n3-torchd \u0026 n3-net-api\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhokim98%2Fn3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhokim98%2Fn3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhokim98%2Fn3/lists"}