{"id":17282832,"url":"https://github.com/narumiruna/mlconfig","last_synced_at":"2025-09-09T05:45:40.262Z","repository":{"id":35171305,"uuid":"207804382","full_name":"narumiruna/mlconfig","owner":"narumiruna","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-10T17:50:26.000Z","size":369,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T10:07:55.726Z","etag":null,"topics":["configuration","deep-learning","machine-learning","pytorch"],"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/narumiruna.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,"zenodo":null}},"created_at":"2019-09-11T12:14:41.000Z","updated_at":"2025-04-10T17:50:29.000Z","dependencies_parsed_at":"2023-01-15T15:13:10.476Z","dependency_job_id":"7400086f-adf3-4254-b6f7-974a0358df00","html_url":"https://github.com/narumiruna/mlconfig","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumiruna%2Fmlconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumiruna%2Fmlconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumiruna%2Fmlconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narumiruna%2Fmlconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narumiruna","download_url":"https://codeload.github.com/narumiruna/mlconfig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860266,"owners_count":21173342,"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":["configuration","deep-learning","machine-learning","pytorch"],"created_at":"2024-10-15T09:49:52.106Z","updated_at":"2025-04-14T10:08:21.116Z","avatar_url":"https://github.com/narumiruna.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mlconfig\n\n## Installation\n\n```shell\n$ pip install mlconfig\n```\n\n## Example\n\n[config.yaml](example/conf.yaml)\n```yaml\nnum_classes: 50\n\nmodel:\n  name: LeNet\n  num_classes: ${num_classes}\n\noptimizer:\n  name: Adam\n  lr: 1.e-3\n  weight_decay: 1.e-4\n```\n\n[main.py](example/main.py)\n```python\nfrom torch import nn\nfrom torch import optim\n\nfrom mlconfig import instantiate\nfrom mlconfig import load\nfrom mlconfig import register\n\nregister(optim.Adam)\n\n\n@register\nclass LeNet(nn.Module):\n\n    def __init__(self, num_classes):\n        super(LeNet, self).__init__()\n        self.num_classes = num_classes\n\n        self.features = nn.Sequential(\n            nn.Conv2d(1, 6, 5, bias=False),\n            nn.ReLU(inplace=True),\n            nn.MaxPool2d(2, 2),\n            nn.Conv2d(6, 16, 5, bias=False),\n            nn.ReLU(inplace=True),\n            nn.MaxPool2d(2, 2),\n        )\n\n        self.classifier = nn.Sequential(\n            nn.Linear(16 * 5 * 5, 120),\n            nn.ReLU(inplace=True),\n            nn.Linear(120, 84),\n            nn.ReLU(inplace=True),\n            nn.Linear(84, self.num_classes),\n        )\n\n    def forward(self, x):\n        x = self.features(x)\n        x = x.view(x.size(0), -1)\n        x = self.classifier(x)\n        return x\n\n\ndef main():\n    config = load('conf.yaml')\n\n    model = instantiate(config.model)\n    optimizer = instantiate(config.optimizer, model.parameters())\n\n\nif __name__ == '__main__':\n    main()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumiruna%2Fmlconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarumiruna%2Fmlconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarumiruna%2Fmlconfig/lists"}