{"id":50337501,"url":"https://github.com/iwhalen/nsga-net","last_synced_at":"2026-05-29T14:33:22.841Z","repository":{"id":39005248,"uuid":"134607961","full_name":"iwhalen/nsga-net","owner":"iwhalen","description":"NSGA-Net, a Neural Architecture Search Algorithm","archived":false,"fork":false,"pushed_at":"2019-08-19T14:07:08.000Z","size":2549,"stargazers_count":278,"open_issues_count":17,"forks_count":83,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-11-29T22:39:59.618Z","etag":null,"topics":["auto-ml","deep-learning","evolutionary-computation","neural-architecture-search","nsga-ii","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iwhalen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-23T18:05:26.000Z","updated_at":"2025-11-19T07:35:32.000Z","dependencies_parsed_at":"2022-09-12T20:23:23.669Z","dependency_job_id":null,"html_url":"https://github.com/iwhalen/nsga-net","commit_stats":null,"previous_names":["iwhalen/nsga-net"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iwhalen/nsga-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwhalen%2Fnsga-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwhalen%2Fnsga-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwhalen%2Fnsga-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwhalen%2Fnsga-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwhalen","download_url":"https://codeload.github.com/iwhalen/nsga-net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwhalen%2Fnsga-net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33657690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":["auto-ml","deep-learning","evolutionary-computation","neural-architecture-search","nsga-ii","pytorch"],"created_at":"2026-05-29T14:33:22.024Z","updated_at":"2026-05-29T14:33:22.832Z","avatar_url":"https://github.com/iwhalen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# NSGA-Net\nCode accompanying the paper. All codes assume running from root directory. Please update the sys path at the beginning of the codes before running.\n\u003e [NSGA-Net: Neural Architecture Search using Multi-Objective Genetic Algorithm](https://arxiv.org/abs/1810.03522)\n\u003e\n\u003e Zhichao Lu, Ian Whalen, Vishnu Boddeti, Yashesh Dhebar, Kalyanmoy Deb, Erik Goodman and Wolfgang Banzhaf\n\u003e\n\u003e *arXiv:1810.03522*\n\n![overview](https://github.com/ianwhale/nsga-net/blob/beta/img/overview_redraw.png  \"Overview of NSGA-Net\")\n\n## Requirements\n``` \nPython \u003e= 3.6.8, PyTorch \u003e= 1.0.1.post2, torchvision \u003e= 0.2.2, pymoo == 0.3.0\n```\n\n## Results on CIFAR-10\n![cifar10_pareto](https://github.com/ianwhale/nsga-net/blob/master/img/cifar10.png  \"cifar10\")\n\n## Pretrained models on CIFAR-10\nThe easiest way to get started is to evaluate our pretrained NSGA-Net models.\n\n#### Macro search space ([NSGA-Net-macro](https://drive.google.com/file/d/173_CXA_YbEjg1_Lnfg6vqweTRDiuDi0J/view?usp=sharing))\n![macro_architecture](https://github.com/ianwhale/nsga-net/blob/beta/img/encoding.png  \"architecture\")\n``` shell\npython validation/test.py --net_type macro --model_path weights.pt\n```\n- Expected result: *3.73%* test error rate with *3.37M* model parameters, *1240M* Multiply-Adds.\n\n#### Micro search space\n![micro_architecture](https://github.com/ianwhale/nsga-net/blob/beta/img/cells.png  \"Normal\u0026Reduction Cells\")\n``` shell\npython validation/test.py --net_type micro --arch NSGANet --init_channels 26 --filter_increment 4 --SE --auxiliary --model_path weights.pt\n```\n- Expected result: *2.43%* test error rate with *1.97M* model parameters, *417M* Multiply-Adds ([*weights.pt*](https://drive.google.com/open?id=1JvMkT1eo6JegtUvT-5qY4LK3xgq-k-OH)). \n\n``` shell\npython validation/test.py --net_type micro --arch NSGANet --init_channels 34 --filter_increment 4 --auxiliary --model_path weights.pt\n```\n- Expected result: *2.22%* test error rate with *2.20M* model parameters, *550M* Multiply-Adds ([*weights.pt*](https://drive.google.com/open?id=1it_aFoez-U7SkxSuRPYWDVFg8kZwE7E7)). \n\n``` shell\npython validation/test.py --net_type micro --arch NSGANet --init_channels 36 --filter_increment 6 --SE --auxiliary --model_path weights.pt\n```\n- Expected result: *2.02%* test error rate with *4.05M* model parameters, *817M* Multiply-Adds ([*weights.pt*](https://drive.google.com/open?id=1kLXzKxQ7dazjmANTvgSoeMPHWwYKiOtm)). \n\n## Pretrained models on CIFAR-100\n``` shell\npython validation/test.py --task cifar100 --net_type micro --arch NSGANet --init_channels 36 --filter_increment 6 --SE --auxiliary --model_path weights.pt\n```\n- Expected result: *14.42%* test error rate with *4.1M* model parameters, *817M* Multiply-Adds ([*weights.pt*](https://drive.google.com/open?id=1CMtSg1l2V5p0HcRxtBsD8syayTtS9QAu)). \n\n## Architecture validation\nTo validate the results by training from scratch, run\n``` \n# architecture found from macro search space\npython validation/train.py --net_type macro --cutout --batch_size 128 --epochs 350 \n# architecture found from micro search space\npython validation/train.py --net_type micro --arch NSGANet --layers 20 --init_channels 34 --filter_increment 4  --cutout --auxiliary --batch_size 96 --droprate 0.2 --SE --epochs 600\n```\nYou may need to adjust the batch_size depending on your GPU memory. \n\nFor customized macro search space architectures, change `genome` and `channels` option in `train.py`. \n\nFor customized micro search space architectures, specify your architecture in `models/micro_genotypes.py` and use `--arch` flag to pass the name. \n\n\n## Architecture search \nTo run architecture search:\n``` shell\n# macro search space\npython search/evolution_search.py --search_space macro --init_channels 32 --n_gens 30\n# micro search space\npython search/evolution_search.py --search_space micro --init_channels 16 --layers 8 --epochs 20 --n_offspring 20 --n_gens 30\n```\nPareto Front               |  Network                  \n:-------------------------:|:-------------------------:\n![](https://github.com/ianwhale/nsga-net/blob/beta/img/pf_macro.gif)  |  ![](https://github.com/ianwhale/nsga-net/blob/beta/img/macro_network.gif)\n\nPareto Front               |  Normal Cell              | Reduction Cell\n:-------------------------:|:-------------------------:|:-------------------------:\n![](https://github.com/ianwhale/nsga-net/blob/beta/img/pf_micro.gif)  |  ![](https://github.com/ianwhale/nsga-net/blob/beta/img/nd_normal_cell.gif)  |  ![](https://github.com/ianwhale/nsga-net/blob/beta/img/nd_reduce_cell.gif)\n\nIf you would like to run asynchronous and parallelize each architecture's back-propagation training, set `--n_offspring` to `1`. The algorithm will run in *steady-state* mode, in which the population is updated as soon as one new architecture candidate is evaludated. It works reasonably well in single-objective case, a similar strategy is used in [here](https://arxiv.org/abs/1802.01548).  \n\n## Visualization\nTo visualize the architectures:\n``` shell\npython visualization/macro_visualize.py NSGANet            # macro search space architectures\npython visualization/micro_visualize.py NSGANet            # micro search space architectures\n```\nFor customized architecture, first define the architecture in `models/*_genotypes.py`, then substitute `NSGANet` with the name of your customized architecture. \n\n## Citations\nIf you find the code useful for your research, please consider citing our works\n``` \n@article{nsganet,\n  title={NSGA-NET: a multi-objective genetic algorithm for neural architecture search},\n  author={Lu, Zhichao and Whalen, Ian and Boddeti, Vishnu and Dhebar, Yashesh and Deb, Kalyanmoy and Goodman, Erik and  Banzhaf, Wolfgang},\n  booktitle={GECCO-2019},\n  year={2018}\n}\n```\n\n## Acknowledgement \nCode heavily inspired and modified from [pymoo](https://github.com/msu-coinlab/pymoo), [DARTS](https://github.com/quark0/darts#requirements) and [pytorch-cifar10](https://github.com/kuangliu/pytorch-cifar). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwhalen%2Fnsga-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwhalen%2Fnsga-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwhalen%2Fnsga-net/lists"}