{"id":13716955,"url":"https://github.com/awentzonline/pytorch-cns","last_synced_at":"2025-04-13T02:32:51.596Z","repository":{"id":57457911,"uuid":"98122813","full_name":"awentzonline/pytorch-cns","owner":"awentzonline","description":"Generalized Compressed Network Search with PyTorch","archived":false,"fork":false,"pushed_at":"2017-11-01T04:50:51.000Z","size":74,"stargazers_count":26,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T20:54:58.895Z","etag":null,"topics":[],"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/awentzonline.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":"2017-07-23T20:14:19.000Z","updated_at":"2024-01-04T16:15:53.000Z","dependencies_parsed_at":"2022-09-07T01:53:34.855Z","dependency_job_id":null,"html_url":"https://github.com/awentzonline/pytorch-cns","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/awentzonline%2Fpytorch-cns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awentzonline%2Fpytorch-cns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awentzonline%2Fpytorch-cns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awentzonline%2Fpytorch-cns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awentzonline","download_url":"https://codeload.github.com/awentzonline/pytorch-cns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657824,"owners_count":21140842,"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-08-03T00:01:16.010Z","updated_at":"2025-04-13T02:32:51.252Z","avatar_url":"https://github.com/awentzonline.png","language":"Python","funding_links":[],"categories":["Pytorch \u0026 related libraries｜Pytorch \u0026 相关库","Pytorch \u0026 related libraries"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"PyTorch-CNS\n==============\nAn implementation of [Generalized Compressed Network Search](http://people.idsia.ch/~juergen/compressednetworksearch.html)\nfor PyTorch models.\n\nThis creates a genome per layer, rather than a single one for the entire model as is described in the paper.\n\nThere are two optimizers:\n * Asynchronous Gene Pool: a master list of genomes, sorted by fitness, is worked\n on by a pool of agents which draw fit genomes for mutation and evaluation.\n * Synchronous Score Swap: each worker maintains a full copy of all genomes and\n only fitness scores are exchanged.\n\nInstallation\n------------\nInstall python package with `pip install pytorch-cns`\n\nInstall [redis](https://redis.io/) which is used as the datastore. The examples\nexpect a redis instance listening on localhost at the default port. You can change\nthis by passing a JSON dict of `StrictRedis` kwargs via the `--redis-params` command\nline option.\n\nAI Gym Examples\n---------------\n * `aigym.py`: CartPole!\n * `atari.py`: Atari ram-based games\n * `atari_pix.py`: Atari pixel-based games\n * `atari_pixrnn_gpa.py`: Atari pixel-based games with a recurrent neural network,\n using the asynchronous gene pool optimizer.\n * `atari_pixrnn_ss.py`: Atari pixel-based games with a recurrent neural network,\n using the synchronous\n\nInstall additional requirements: `pip install gym atari_py box2d`\n\nTo run a pool of workers with default settings simply run the python file\n(e.g. `python atari_pix.py`). If you make any changes to the hyperparameters\nyou'll to use the `--clear-store` flag which deletes the old gene pool upon start.\nUse `--num-agents` to customize the number of child processes spawned.\n\nInvoke the example with `python atari_pix.py --render --best` to run the simulation\nwith the fittest genome. This can be done at the same time as the workers are\nrunning to monitor progress.\n\nImage generation\n----------------\nThese do not converge on anything at the moment. Maybe, if you are a real GANimal,\nyou can find the right configuration. The code here is hacked together from\nthe pytorch example repo.\n\n`cnsdcgan.py`: DCGAN adapted from the PyTorch DCGAN example. Attempts to train\nboth the discriminator and generator with compressed network search.\n\n`vggmse.py`: An autoencoder which uses VGG16 to calculate the loss.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawentzonline%2Fpytorch-cns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawentzonline%2Fpytorch-cns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawentzonline%2Fpytorch-cns/lists"}