{"id":13679482,"url":"https://github.com/chrhenning/hypnettorch","last_synced_at":"2025-04-29T19:31:18.903Z","repository":{"id":43299817,"uuid":"414284063","full_name":"chrhenning/hypnettorch","owner":"chrhenning","description":"Package for working with hypernetworks in PyTorch.","archived":false,"fork":false,"pushed_at":"2023-09-07T20:28:39.000Z","size":841,"stargazers_count":122,"open_issues_count":0,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T19:36:38.647Z","etag":null,"topics":["deep-learning","hypernet","hypernets","hypernetwork","hypernetworks","neural-network","python","pytorch","torch"],"latest_commit_sha":null,"homepage":"https://hypnettorch.readthedocs.io/","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/chrhenning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2021-10-06T16:14:06.000Z","updated_at":"2025-02-17T03:44:15.000Z","dependencies_parsed_at":"2024-01-14T17:18:16.114Z","dependency_job_id":"2413309a-72e2-4c2a-acec-761850d9b5cd","html_url":"https://github.com/chrhenning/hypnettorch","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":0.5161290322580645,"last_synced_commit":"974dc5d445801f2c41648dd8156ea4628bb7b98e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrhenning%2Fhypnettorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrhenning%2Fhypnettorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrhenning%2Fhypnettorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrhenning%2Fhypnettorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrhenning","download_url":"https://codeload.github.com/chrhenning/hypnettorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251569548,"owners_count":21610575,"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":["deep-learning","hypernet","hypernets","hypernetwork","hypernetworks","neural-network","python","pytorch","torch"],"created_at":"2024-08-02T13:01:05.997Z","updated_at":"2025-04-29T19:31:18.198Z","avatar_url":"https://github.com/chrhenning.png","language":"Python","funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Hypernetworks for PyTorch\n\n[This package](https://hypnettorch.readthedocs.io) contains utilities that make it easy to work with [hypernetworks](https://arxiv.org/abs/1609.09106) in [PyTorch](https://pytorch.org/).\n\n## Installation\n\nYou can either install the latest package version via\n\n```\npython3 -m pip install hypnettorch\n```\n\nor, you directly install the current sources\n\n```\npython3 -m pip install git+https://github.com/chrhenning/hypnettorch\n```\n\n#### Installation for developers\n\nIf you actively develop the package, it is easiest to install it in `development mode`, such that all changes that are done to source files are directly visible when you use the package.\n\nClone the repository to a location of your choice\n\n```\ngit clone https://github.com/chrhenning/hypnettorch.git\n```\n\nand move inside the cloned repo\n\n```\ncd ./hypnettorch\n```\n\nNow, you can simply **install** the package in `editable` mode, which will ensure that you can easily update the package sources (cf. [development mode](https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html))\n\n```\npip3 install --editable . --user\n```\n\nSince the package was installed in `editable` mode, you can always update the sources simply by pulling the most recent code\n\n```\ngit pull\n```\n\nYou can **uninstall** the package at any point by running `python3 setup.py develop -u`.\n\n## Usage\n\nThe basic functionalities of the package are quite intuitive and easy to use, e.g.,\n\n```python\nimport torch\nfrom hypnettorch.mnets import MLP\nfrom hypnettorch.hnets import HMLP\nmnet = MLP(n_in=8, n_out=1, no_weights=True) # Create MLP with 8 inputs and 1 output.\nhnet = HMLP(mnet.param_shapes) # Create hypernetwork for the above MLP.\nweights = hnet.forward(cond_id=0) # Generate the weights of network `mnet`.\ninputs = torch.rand(32, 8) # Random inputs.\nmnet.forward(inputs, weights=weights) # Compute predictions using the generated weights.\n```\n\nThere are several [tutorials](https://github.com/chrhenning/hypnettorch/tree/master/hypnettorch/tutorials). Check out the [getting started](https://github.com/chrhenning/hypnettorch/blob/master/hypnettorch/tutorials/getting_started.ipynb) tutorial when working with ``hypnettorch`` for the first time.\n\nYou may also checkout the [examples](https://hypnettorch.readthedocs.io/en/latest/examples.html). For instance, how to use hypernetworks for continual learning.\n\n## Documentation\n\nThe documentation can be found [here](https://hypnettorch.readthedocs.io).\n\n#### Note for developers\n\nThe documentation can be build using \n\n```\npython3 setup.py build_sphinx\n```\n\nand opened via the file [index.html](docs/html/index.html).\n\n## Citation\n\nWhen using this package in your research project, please consider citing one of our papers for which this package has been developed.\n\n```\n@inproceedings{posterior:replay:2021:henning:cervera,\ntitle={Posterior Meta-Replay for Continual Learning}, \n      author={Christian Henning and Maria R. Cervera and Francesco D'Angelo and Johannes von Oswald and Regina Traber and Benjamin Ehret and Seijin Kobayashi and Benjamin F. Grewe and João Sacramento},\nbooktitle={Conference on Neural Information Processing Systems},\nyear={2021},\nurl={https://arxiv.org/abs/2103.01133}\n}\n```\n\n```\n@inproceedings{ehret2020recurrenthypercl,\n  title={Continual Learning in Recurrent Neural Networks},\n  author={Benjamin Ehret and Christian Henning and Maria R. Cervera and Alexander Meulemans and Johannes von Oswald and Benjamin F. Grewe},\n  booktitle={International Conference on Learning Representations},\n  year={2021},\n  url={https://arxiv.org/abs/2006.12109}\n}\n```\n\n```\n@inproceedings{oshg2019hypercl,\ntitle={Continual learning with hypernetworks},\nauthor={Johannes von Oswald and Christian Henning and Benjamin F. Grewe and Jo{\\~a}o Sacramento},\nbooktitle={International Conference on Learning Representations},\nyear={2020},\nurl={https://arxiv.org/abs/1906.00695}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrhenning%2Fhypnettorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrhenning%2Fhypnettorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrhenning%2Fhypnettorch/lists"}