{"id":15398572,"url":"https://github.com/sjain-stanford/deep-route","last_synced_at":"2026-02-28T02:43:19.690Z","repository":{"id":23911290,"uuid":"99827036","full_name":"sjain-stanford/deep-route","owner":"sjain-stanford","description":"Training a deep FCN network in PyTorch to route circuit layouts","archived":false,"fork":false,"pushed_at":"2022-12-07T23:29:22.000Z","size":434,"stargazers_count":67,"open_issues_count":10,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-16T01:51:18.246Z","etag":null,"topics":["convolutional-neural-networks","deep-learning","fully-convolutional-networks","integrated-circuits","pytorch","routing"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1706.08948","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/sjain-stanford.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":"2017-08-09T15:59:05.000Z","updated_at":"2024-11-10T09:39:40.000Z","dependencies_parsed_at":"2023-01-14T00:04:10.832Z","dependency_job_id":null,"html_url":"https://github.com/sjain-stanford/deep-route","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sjain-stanford/deep-route","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjain-stanford%2Fdeep-route","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjain-stanford%2Fdeep-route/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjain-stanford%2Fdeep-route/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjain-stanford%2Fdeep-route/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjain-stanford","download_url":"https://codeload.github.com/sjain-stanford/deep-route/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjain-stanford%2Fdeep-route/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29923425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["convolutional-neural-networks","deep-learning","fully-convolutional-networks","integrated-circuits","pytorch","routing"],"created_at":"2024-10-01T15:44:41.192Z","updated_at":"2026-02-28T02:43:19.661Z","avatar_url":"https://github.com/sjain-stanford.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep-Route\n\nThis repository contains PyTorch implementation (pretrained weights provided) and dataset generation code for the paper\n\n**[Training a Fully Convolutional Neural Network to Route Integrated Circuits](https://arxiv.org/abs/1706.08948)**\n\u003cbr\u003e\n[Sambhav R. Jain](https://bit.ly/sjain-stanford), Kye Okabe\n\u003cbr\u003e\narXiv-cs.CV (Computer Vision and Pattern Recognition) 2017\n\nWe design and train a deep, fully convolutional neural network that learns to route a circuit layout net with appropriate choice of metal tracks and wire class combinations. Inputs to the network are the encoded layouts containing spatial location of pins to be routed. After 15 fully convolutional stages followed by a score comparator, the network outputs 8 layout layers (corresponding to 4 route layers, 3 via layers and an identity-mapped pin layer) which are then decoded to obtain the routed layouts.\n\n**Proposed FCN Model**\n\u003cimg src='figs/Network.png'\u003e\n\n**Training samples (left: data, right: labels) from the generated dataset**\n\u003cimg src='figs/sample_data.jpg'\u003e\n\n## Install (Linux)\n1. Fork [this GitHub repository](https://github.com/sjain-stanford/deep-route)\n2. Setup virtualenv and install dependencies\n     * `./setup_virtualenv.sh`\n3. Install PyTorch\n     * `./setup_pytorch.sh` \n4. Activate virtualenv, start Jupyter notebook\n    * `./start_jupyter_env.sh`\n\n## Generate Dataset\nRun the script `./datagen/gen_data.py` to generate training data of shape (N, 1, H, W) and labels of shape (N, 8, H, W) stored using [HDF5 (h5py)](https://github.com/h5py/h5py). Default parameters used for the paper are `H = W = 32`, and `pin_range = (2, 6)`, but feel free to modify as desired. Generating 50,000 image dataset should take \u003c 1 minute.\n```\npython ./datagen/gen_data.py\n\u003e\u003e Enter the number of images to be generated: 50000\nmv ./data/layout_data.hdf5 ./model/data/train_50k_32pix.hdf5\n\npython ./datagen/gen_data.py\n\u003e\u003e Enter the number of images to be generated: 10000\nmv ./data/layout_data.hdf5 ./model/data/val_10k_32pix.hdf5\n```\n\n## Train FCN Network (in PyTorch)\nSwitch to `./model/` dir and run the script `./train_fcn_pytorch.py` to train the FCN model with default options, or use the switch `--help` to display a list of options and their defaults.\n```\ncd ./model/\npython ./train_fcn_pytorch.py --help\n```\n\n```\nusage: train_fcn_pytorch.py [-h] [--data PATH] [--batch_size N]\n                            [--num_workers N] [--num_epochs N] [--use_gpu]\n                            [--pretrained] [--lr LR] [--adapt_lr] [--reg REG]\n                            [--print-freq N]\n\nDeep-Route: Training a deep FCN network to route circuit layouts.\n\noptional arguments:\n  -h, --help       show this help message and exit\n  --data PATH      path to dataset (default: ./data/)\n  --batch_size N   mini-batch size (default: 100)\n  --num_workers N  number of data loading workers (default: 4)\n  --num_epochs N   number of total epochs to run (default: 200)\n  --use_gpu        use GPU if available\n  --pretrained     use pre-trained model\n  --lr LR          initial learning rate (default: 5e-4)\n  --adapt_lr       use learning rate schedule\n  --reg REG        regularization strength (default: 1e-5)\n  --print-freq N   print frequency (default: 10)\n```\n\nTo run on GPU, provide switch `--use_gpu`. Best model parameters (based on F-1 score on validation set) are saved to `./model/training/` dir every epoch, along with loss and training curves. If the switch `--pretrained` is provided, model is pre-loaded with saved parameters before training. Pretrained weights (for batch size 10 and 100) are made available [here](https://github.com/sjain-stanford/pretrained-weights). With `--adapt_lr`, a learning rate decay factor of 10 is applied every 30 epochs.\n\n## Cite\nIf you find this work useful in your research, please cite:\n```\n@article{jain2017route,\n  title={Training a Fully Convolutional Neural Network to Route Integrated Circuits},\n  author={Jain, Sambhav R and Okabe, Kye},\n  journal={arXiv preprint arXiv:1706.08948},\n  year={2017}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjain-stanford%2Fdeep-route","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjain-stanford%2Fdeep-route","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjain-stanford%2Fdeep-route/lists"}