{"id":13737007,"url":"https://github.com/moskomule/dda","last_synced_at":"2026-03-15T23:03:24.229Z","repository":{"id":113718664,"uuid":"243956057","full_name":"moskomule/dda","owner":"moskomule","description":"Differentiable Data Augmentation Library","archived":false,"fork":false,"pushed_at":"2022-08-07T06:28:56.000Z","size":2799,"stargazers_count":123,"open_issues_count":2,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T10:47:36.844Z","etag":null,"topics":["data-augmentation","differentiable-data-augmentation","faster-auto-augment","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/moskomule.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":"2020-02-29T11:25:44.000Z","updated_at":"2025-02-25T14:08:42.000Z","dependencies_parsed_at":"2023-05-19T22:45:27.483Z","dependency_job_id":null,"html_url":"https://github.com/moskomule/dda","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moskomule%2Fdda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moskomule%2Fdda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moskomule%2Fdda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moskomule%2Fdda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moskomule","download_url":"https://codeload.github.com/moskomule/dda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248973387,"owners_count":21191956,"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":["data-augmentation","differentiable-data-augmentation","faster-auto-augment","pytorch"],"created_at":"2024-08-03T03:01:33.432Z","updated_at":"2026-03-15T23:03:19.199Z","avatar_url":"https://github.com/moskomule.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# Differentiable Data Augmentation Library\n\n![](https://github.com/moskomule/dda/workflows/pytest/badge.svg)\n\nThis library is a core of Faster AutoAugment and its descendants. This library is research oriented, and its AIP may change in the near future.\n\n## Requirements and Installation\n\n### Requirements\n\n```\nPython\u003e=3.8\nPyTorch\u003e=1.5.0\ntorchvision\u003e=0.6\nkornia\u003e=0.2\n```\n\n### Installation\n\n```\npip install -U git+https://github.com/moskomule/dda\n```\n\n## APIs\n\n### `dda.functional`\n\nBasic operations that can be differentiable w.r.t. the magnitude parameter `mag`. When `mag=0`, no augmentation is applied, and when `mag=1` (and `mag=-1` if it exists), the severest augmentation is applied. As introduced in Faster AutoAugment, some operations use straight-through estimator to be differentiated w.r.t. their magnitude parameters.\n\n```python\ndef operation(img: torch.Tensor,\n              mag: Optional[torch.Tensor]) -\u003e torch.Tensor:\n    ...\n```\n\n`dda.pil` contains the similar APIs using PIL (not differentiable).\n\n\n### `dda.operations`\n\n```python\nclass Operation(nn.Module):\n   \n    def __init__(self,\n                 initial_magnitude: Optional[float] = None,\n                 initial_probability: float = 0.5,\n                 magnitude_range: Optional[Tuple[float, float]] = None,\n                 probability_range: Optional[Tuple[float, float]] = None,\n                 temperature: float = 0.1,\n                 flip_magnitude: bool = False,\n                 magnitude_scale: float = 1,\n                 debug: bool = False):\n        ...\n```\n\nIf `magnitude_range=None`, `probability_range=None`, then `magnitude`, `probability` is not Parameter but Buffer, respectively.\n\n`magnitude` moves in `magnitude_scale * magnitude_range`. \nFor example, `dda.operations.Rotation` has `magnitude_range=[0, 1]` and `magnitude_scale=30` so that magnitude is between 0 to 30 degrees. \n\nTo differentiate w.r.t. the probability parameter, `RelaxedBernoulli` is used.\n\n## Examples\n\n* [Faster AutoAugment](./faster_autoaugment)\n* [RandAugment](./examples)\n\n## Citation\n\n`dda` (except RandAugment) is developed as a core library of the following research projects. \n\nIf you use `dda` in your academic research, please cite `hataya2020a`.\n\n```bibtex\n@inproceesings{hataya2020a,\n    title={{Faster AutoAugment: Learning Augmentation Strategies using Backpropagation}},\n    author={Ryuichiro Hataya and Jan Zdenek and Kazuki Yoshizoe and Hideki Nakayama},\n    year={2020},\n    booktitle={ECCV}\n}\n\n...\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoskomule%2Fdda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoskomule%2Fdda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoskomule%2Fdda/lists"}