{"id":13499053,"url":"https://github.com/bowenbaker/metaqnn","last_synced_at":"2025-03-29T03:32:17.698Z","repository":{"id":104526904,"uuid":"72878913","full_name":"bowenbaker/metaqnn","owner":"bowenbaker","description":null,"archived":false,"fork":false,"pushed_at":"2017-07-18T16:09:54.000Z","size":2489,"stargazers_count":137,"open_issues_count":2,"forks_count":37,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-31T17:39:09.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bowenbaker.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}},"created_at":"2016-11-04T19:28:46.000Z","updated_at":"2024-07-24T20:46:31.000Z","dependencies_parsed_at":"2023-10-20T18:35:18.477Z","dependency_job_id":null,"html_url":"https://github.com/bowenbaker/metaqnn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowenbaker%2Fmetaqnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowenbaker%2Fmetaqnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowenbaker%2Fmetaqnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bowenbaker%2Fmetaqnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bowenbaker","download_url":"https://codeload.github.com/bowenbaker/metaqnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246135766,"owners_count":20729056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T22:00:27.666Z","updated_at":"2025-03-29T03:32:17.258Z","avatar_url":"https://github.com/bowenbaker.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes"],"sub_categories":["MetaQNN"],"readme":"MetaQNN Codebase\n========\n\nMetaQNN is a codebase used for automatically designing convolutional neural network architectures outlined in the paper: \n\n**[Designing Neural Network Architectures Using Reinforcement Learning](https://arxiv.org/pdf/1611.02167.pdf)**   \nBowen Baker, Otkrist Gupta, Nikhil Naik, Ramesh Raskar  \n*International Conference on Learning Representations*, 2017\n\nIf our software or paper helps your research or project, please cite us using:\n\n    @article{baker2017designing,\n      title={Designing Neural Network Architectures using Reinforcement Learning},\n      author={Baker, Bowen and Gupta, Otkrist and Naik, Nikhil and Raskar, Ramesh},\n      journal={International Conference on Learning Representations},\n      year={2017}\n    }\n\n# Installation\nAll code was only tested on ubuntu 16.04, python 2.7, with caffe at commit [d208b71](https://github.com/BVLC/caffe/tree/d208b714abb8425f1b96793e04508ad21724ae3f)\n\n1. Install caffe using these [instructions](https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide) with CUDA 8 and cuDNN 5.1.\n2. ```pip install -r requirements.txt```\n\n# Quick Example (CIFAR-10)\n1. Create CIFAR-10 LMDB's on each server you plan to use for training  \n\n    ``` bash\n    python libs/input_modules/lmdb_creator.py cifar10 /path/to/data/directory/cifar10 -gcn True -v 5000\n    ```\n    \n2. Modify `models/cifar10/hyper_parameters.py`  \n  2a. set `TRAIN_FILE = '/path/to/data/directory/cifar10/train.lmdb'`  \n  2b. set `VAL_FILE = '/path/to/data/directory/cifar10/val.lmdb'`  \n  2c. set `CAFFE_ROOT = '/path/to/caffe/installation/directory'`  \n  2d. (optional) set `CHECKPOINT_DIR = '/path/to/model/snapshot/directory/'`  \n3. Create directory `cifar10_logs` to store Q-values and replay database\n4. Start Q-Learning Server\n\n    ```bash \n    python q_server.py cifar10 cifar10_logs\n    ```\n    \n5. On each server you want to use for training start a Q-Learning Client\n\n    ```bash\n    python caffe_client.py cifar10 unique_client_identifier server_ip_addr\n    ```\n    If you want to use a specific gpu, for example GPU 4\n    ```bash\n    python caffe_client.py cifar10 unique_client_identifier server_ip_addr -gpu 4\n    ```\n    If you are using a multi-gpu server and want to run 4 clients that use GPUs 0 1 3 5 (This command requires you to have tmux installed)\n    ```bash\n    ./caffe_multiclient.sh cifar10 unique_client_identifier server_ip_addr 0 1 3 5\n    ```\n\n# MetaQNN Code Description\n\nExperiment configurations are stored in the `models` folder. Each experiment contains a `hyper_parameters.py` file that contains optimization hyperparameters, data paths, etc., and a `state_space_parameters.py` file that contains state space specifications. The sample experiments are densely commented so that you may easily change around the experiment configurations.\n\nWe implemented the Q-Learning algorithm in a distributed server-client framework. One server runs the Q-Learning algorithm and sends out jobs to train CNNs on client servers. We currently only have published a client that uses Caffe for CNN training. If there is enough interest I will publish a client that uses MXNet as well.\n\n## Dataset Creation\nWe provide easy-to-use helper functions to download and preprocess the CIFAR-10, CIFAR-100, MNIST, and SVHN datasets. It supports standard whitening, local contrast normalization, global contrast normalization, mean subtraction, and padding. The module will save both training and validation lmdbs as well as the full training set and test set lmdbs to the specified location. To see all options run\n```bash\npython libs/input_modules/lmdb_creator.py -h\n```\n#### Examples\n1. Create CIFAR-10 dataset with global contrast normalization and 5000 validation images run\n\n    ```bash\n    python libs/input_modules/lmdb_creator.py cifar10 /path/to/data/directory/cifar10 -gcn True -v 5000\n    ```\n    \n2. Create MNIST dataset with mean subtraction and 10000 validation images\n\n    ```bash\n    python libs/input_modules/lmdb_creator.py mnist /path/to/data/directory/mnist -ms True -v 10000\n    ```\n\n3. Create the SVHN dataset with the extra 531131 training images and local contrast normalization and standard validation set\n\n    ```bash\n    python libs/input_modules/lmdb_creator.py svhn_full /path/to/data/directory/svhn_full -prep lcn \n    ```\n    \n4. Create the 10% SVHN dataset with standard whitening\n\n    ```bash\n    python libs/input_modules/lmdb_creator.py svhn_small /path/to/data/directory/svhn -prep standard_whiten\n    ```\n\n# Speeding Up Meta-Modeling with Performance Prediction\n\nIf you have limited hardware or just want to run through a larger number of networks, we highly recommend implementing early stopping with simple performance prediction models as outlined in our recent paper\n\n**[Practical Neural Network Performance Prediction for Early Stopping](https://arxiv.org/pdf/1705.10823.pdf)**   \nBowen Baker\\*, Otkrist Gupta\\*, Nikhil Naik, Ramesh Raskar  \n*Under Submission*\n\nWe will be releasing code for this before the end of the summer, but the method is extremely simple so you shouldn't have any trouble implementing it yourself if you need to use it before our release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowenbaker%2Fmetaqnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbowenbaker%2Fmetaqnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbowenbaker%2Fmetaqnn/lists"}