{"id":13936746,"url":"https://github.com/locuslab/icnn","last_synced_at":"2026-02-28T20:34:16.310Z","repository":{"id":84315482,"uuid":"68150173","full_name":"locuslab/icnn","owner":"locuslab","description":"Input Convex Neural Networks","archived":false,"fork":false,"pushed_at":"2019-03-20T20:04:12.000Z","size":10757,"stargazers_count":289,"open_issues_count":5,"forks_count":50,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-10T02:54:22.477Z","etag":null,"topics":["convex-optimization","deep-learning","reinforcement-learning","research-paper"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1609.07152","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/locuslab.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-13T21:46:37.000Z","updated_at":"2025-04-09T12:32:43.000Z","dependencies_parsed_at":"2023-03-13T20:04:30.444Z","dependency_job_id":null,"html_url":"https://github.com/locuslab/icnn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/locuslab/icnn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Ficnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Ficnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Ficnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Ficnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/icnn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Ficnn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29951658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["convex-optimization","deep-learning","reinforcement-learning","research-paper"],"created_at":"2024-08-07T23:02:57.528Z","updated_at":"2026-02-28T20:34:16.285Z","avatar_url":"https://github.com/locuslab.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Input Convex Neural Networks (ICNNs)\n\nThis repository is by [Brandon Amos](http://bamos.github.io),\n[Leonard Xu](https://github.com/Leonard-Xu),\nand [J. Zico Kolter](http://zicokolter.com)\nand contains the TensorFlow source code to reproduce the\nexperiments in our ICML 2017 paper\n[Input Convex Neural Networks](http://arxiv.org/abs/1609.07152).\n\n![](/RL/misc/pendulum.gif)\n![](/RL/misc/reacher.gif)\n![](/RL/misc/halfcheetah.gif)\n![](/images/completion.gif)\n\nIf you find this repository helpful in your publications,\nplease consider citing our paper.\n\n```\n@InProceedings{amos2017icnn,\n  title = {Input Convex Neural Networks},\n  author = {Brandon Amos and Lei Xu and J. Zico Kolter},\n  booktitle = {Proceedings of the 34th International Conference on Machine Learning},\n  pages = {146--155},\n  year = {2017},\n  volume = {70},\n  series = {Proceedings of Machine Learning Research},\n  publisher = {PMLR},\n}\n```\n\n## Setup and Dependencies\n\n+ Python/numpy\n+ TensorFlow (we used r10)\n+ OpenAI Gym + Mujoco (for the RL experiments)\n\n## Libraries\n\n```\nlib\n└── bundle_entropy.py - Optimize a function over the [0,1] box with the bundle entropy method.\n                        (Development is still in-progress and we are still\n                        fixing some numerical issues here.)\n```\n\n## Synthetic Classification\n\nThis image shows FICNN (top) and PICNN (bottom) classification of synthetic\nnon-convex decision boundaries.\n\n![](/images/synthetic.png)\n\n```\nsynthetic-cls\n├── icnn.py - Main script.\n├── legend.py - Create a figure of just the legend.\n├── make-tile.sh - Make the tile of images.\n└── run.sh - Run all experiments on 4 GPUs.\n```\n\n## Multi-Label Classification\n\n(These are currently slightly inconsistent with our paper\nand we plan on synchronizing our paper and code.)\n\n```\nmulti-label-cls\n├── bibsonomy.py - Loads the Bibsonomy datasets.\n├── ebundle-vs-gd.py - Compare ebundle and gradient descent.\n├── ff.py - Train a feed-forward net baseline.\n├── icnn_ebundle.py - Train an ICNN with the bundle entropy method.\n├── icnn.back.py - Train an ICNN with gradient descent and back differentiation.\n└── icnn.plot.py - Plot the results from any multi-label cls experiment.\n```\n\n## Image Completion\n\nThis image shows the test set completions on the Olivetti faces dataset over\nthe first few iterations of training a PICNN with the bundle entropy method\nfor 5 iterations.\n\n![](/images/completion.gif)\n\n```\ncompletion\n├── icnn.back.py - Train an ICNN with gradient descent and back differentiation.\n├── icnn_ebundle.py - Train an ICNN with the bundle entropy method.\n├── icnn.plot.py - Plot the results from any image completion experiment.\n└── olivetti.py - Loads the Olivetti faces dataset.\n```\n\n## Reinforcement Learning\n\n![](/RL/misc/pendulum.gif)\n![](/RL/misc/reacher.gif)\n![](/RL/misc/halfcheetah.gif)\n\n### Training\n\nFrom the [RL](/RL) directory, run a single experiment with:\n\n```\npython src/main.py --model ICNN --env InvertedPendulum-v1 --outdir output \\\n  --total 100000 --train 100 --test 1 --tfseed 0 --npseed 0 --gymseed 0\n```\n\n+ Use `--model` to select a model from `[DDPG, NAF, ICNN]`.\n+ Use `--env` to select a task. [TaskList](https://gym.openai.com/envs#mujoco)\n+ View all of the parameters with `python main.py -h`.\n\n### Output\n\nThe TensorBoard summary is on by default. Use `--summary False` to\nturn it off. The TensorBoard summary includes (1) average Q value, (2)\nloss function, and (3) average reward for each training minibatch.\n\nThe testing total rewards are logged to log.txt.\nEach line is `[training_timesteps]\t[testing_episode_total_reward]`.\n\n### Settings\n\nTo reproduce our experiments, run the scripts in the\n[RL](/RL) directory.\n\n### Acknowledgments\nThe DDPG portions of our RL code are from\nSimon Ramstedt's\n[SimonRamstedt/ddpg](https://github.com/SimonRamstedt/ddpg)\nrepository.\n\n# Licensing\n\nUnless otherwise stated, the source code is copyright\nCarnegie Mellon University and licensed under the\n[Apache 2.0 License](./LICENSE).\nPortions from the following third party sources have\nbeen modified and are included in this repository.\nThese portions are noted in the source files and are\ncopyright their respective authors with\nthe licenses listed.\n\nProject | License\n---|---|\n| [SimonRamstedt/ddpg](https://github.com/SimonRamstedt/ddpg) | MIT |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Ficnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Ficnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Ficnn/lists"}