{"id":13738547,"url":"https://github.com/pytorch/hydra-torch","last_synced_at":"2025-05-06T18:05:33.507Z","repository":{"id":47648865,"uuid":"298688554","full_name":"pytorch/hydra-torch","owner":"pytorch","description":"Configuration classes enabling type-safe PyTorch configuration for Hydra apps","archived":false,"fork":false,"pushed_at":"2022-09-27T16:43:58.000Z","size":11387,"stargazers_count":215,"open_issues_count":29,"forks_count":17,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-04-30T12:23:58.327Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pytorch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-25T22:05:47.000Z","updated_at":"2025-04-28T02:55:01.000Z","dependencies_parsed_at":"2023-01-18T19:30:52.047Z","dependency_job_id":null,"html_url":"https://github.com/pytorch/hydra-torch","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/pytorch%2Fhydra-torch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytorch%2Fhydra-torch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytorch%2Fhydra-torch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytorch%2Fhydra-torch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytorch","download_url":"https://codeload.github.com/pytorch/hydra-torch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252741373,"owners_count":21797027,"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-03T03:02:26.297Z","updated_at":"2025-05-06T18:05:33.444Z","avatar_url":"https://github.com/pytorch.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# hydra-torch\nConfiguration classes enabling type-safe PyTorch configuration for Hydra apps.  \n**This repo is work in progress.**\n\nThe config dataclasses are generated using [configen](https://github.com/facebookresearch/hydra/tree/main/tools/configen), check it out if you want to generate config dataclasses for your own project.\n\n### Install:\n```\n# For now, please obtain through github. Soon, versioned (per-project) dists will be on PyPI.\npip install git+https://github.com/pytorch/hydra-torch\n```\n\n### Example config:\nHere is one of many configs available. Notice it uses the defaults defined in the torch function signatures:\n```python\n@dataclass\nclass TripletMarginLossConf:\n    _target_: str = \"torch.nn.modules.loss.TripletMarginLoss\"\n    margin: float = 1.0\n    p: float = 2.0\n    eps: float = 1e-06\n    swap: bool = False\n    size_average: Any = None\n    reduce: Any = None\n    reduction: str = \"mean\"\n```\n\n### Importing Convention:\n```python\nfrom hydra_configs.\u003cpackage_name\u003e.path.to.module import \u003cClassName\u003eConf\n```\nwhere `\u003cpackage_name\u003e` is the package being configured and `path.to.module` is the path in the original package.\n\nInferring where the package is located is as simple as prepending `hydra_configs.` and postpending `Conf` to the original class import:\ne.g.\n```python\n#module to be configured\nfrom torch.optim.adam import Adam\n\n#config for the module\nfrom hydra_configs.torch.optim.adam import AdamConf\n```\n\n\n### Getting Started:\nTake a look at our tutorial series:\n1. [Basic Tutorial](examples/mnist_00.md)\n2. Intermediate Tutorial (coming soon)\n3. Advanced Tutorial (coming soon)\n\n### Other Config Projects:\nA list of projects following the `hydra_configs` convention (please notify us if you have one!):\n\n[Pytorch Lightning](https://github.com/romesco/hydra-lightning)\n\n### License\nhydra-torch is licensed under [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytorch%2Fhydra-torch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytorch%2Fhydra-torch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytorch%2Fhydra-torch/lists"}