@@ -32,7 +32,7 @@ def augmix_image(img: ImgT,
32
32
augmentation_set : List = augmentation_sets ["all" ]) -> ImgT :
33
33
"""Applies AugMix (`Hendrycks et al, 2020 <http://arxiv.org/abs/1912.02781>`_) data
34
34
augmentation to a single image or batch of images. See
35
- :class:`~composer.algorithms.augmix.augmix. AugMix` and the
35
+ :class:`. AugMix` and the
36
36
:doc:`Method Card </method_cards/augmix>` for details. This function only acts on a
37
37
single image (or batch) per call and is unlikely to be used in a training loop. Use
38
38
:class:`~composer.algorithms.augmix.augmix.AugmentAndMixTransform` to use AugMix as
@@ -56,12 +56,12 @@ def augmix_image(img: ImgT,
56
56
57
57
Args:
58
58
img (PIL.Image): Image or batch of images to be AugMix'd.
59
- severity (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
60
- depth (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
61
- width (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
62
- alpha (float, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
59
+ severity (int, optional): See :class:`.AugMix`.
60
+ depth (int, optional): See :class:`.AugMix`.
61
+ width (int, optional): See :class:`.AugMix`.
62
+ alpha (float, optional): See :class:`.AugMix`.
63
63
augmentation_set (str, optional): See
64
- :class:`~composer.algorithms.augmix.augmix .AugMix`.
64
+ :class:`.AugMix`.
65
65
66
66
Returns:
67
67
PIL.Image: AugMix'd image.
@@ -102,7 +102,7 @@ def _augmix_pil_image(img_pil: PillowImage, severity: int, depth: int, width: in
102
102
class AugmentAndMixTransform (torch .nn .Module ):
103
103
"""Wrapper module for :func:`~composer.algorithms.augmix.augmix.augmix_image` that can
104
104
be passed to :class:`torchvision.transforms.Compose`. See
105
- :class:`~composer.algorithms.augmix.augmix .AugMix` and the :doc:`Method Card
105
+ :class:`.AugMix` and the :doc:`Method Card
106
106
</method_cards/augmix>` for details.
107
107
108
108
Example:
@@ -123,12 +123,12 @@ class AugmentAndMixTransform(torch.nn.Module):
123
123
transformed_image = composed(image)
124
124
125
125
Args:
126
- severity (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
127
- depth (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
128
- width (int, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
129
- alpha (float, optional): See :class:`~composer.algorithms.augmix.augmix .AugMix`.
126
+ severity (int, optional): See :class:`.AugMix`.
127
+ depth (int, optional): See :class:`.AugMix`.
128
+ width (int, optional): See :class:`.AugMix`.
129
+ alpha (float, optional): See :class:`.AugMix`.
130
130
augmentation_set (str, optional): See
131
- :class:`~composer.algorithms.augmix.augmix .AugMix`.
131
+ :class:`.AugMix`.
132
132
"""
133
133
134
134
def __init__ (self ,
@@ -167,8 +167,8 @@ class AugMix(Algorithm):
167
167
``Dirichlet(alpha, alpha, ...)`` distribution. The coefficient for mixing the combined augmented image and the
168
168
original image is drawn from a ``Beta(alpha, alpha)`` distribution, using the same ``alpha``.
169
169
170
- This algorithm runs on on :attr:`~composer.core.event.Event.FIT_START` to insert a dataset transformation. It is a no-op if this algorithm already
171
- applied itself on the :attr:`State.train_dataloader.dataset`.
170
+ This algorithm runs on on :attr:`~composer.core.event.Event.FIT_START` to insert a dataset transformation.
171
+ It is a no-op if this algorithm already applied itself on the :attr:`State.train_dataloader.dataset`.
172
172
173
173
See the :doc:`Method Card </method_cards/augmix>` for more details.
174
174
@@ -196,14 +196,14 @@ class AugMix(Algorithm):
196
196
197
197
Args:
198
198
severity (int, optional): Severity of augmentations; ranges from 0
199
- (no augmentation) to 10 (most severe). Default = ``3``.
199
+ (no augmentation) to 10 (most severe). Default: ``3``.
200
200
depth (int, optional): Number of augmentations per sequence. -1 enables stochastic
201
- depth sampled uniformly from [1, 3]. Default = ``-1``.
202
- width (int, optional): Number of augmentation sequences. Default = ``3``.
201
+ depth sampled uniformly from [1, 3]. Default: ``-1``.
202
+ width (int, optional): Number of augmentation sequences. Default: ``3``.
203
203
alpha (float, optional): Pseudocount for Beta and Dirichlet distributions. Must be
204
204
> 0. Higher values yield mixing coefficients closer to uniform weighting. As
205
205
the value approaches 0, the mixing coefficients approach using only one
206
- version of each image. Default = ``1.0``.
206
+ version of each image. Default: ``1.0``.
207
207
augmentation_set (str, optional): Must be one of the following options:
208
208
209
209
* ``"augmentations_all"``
@@ -225,7 +225,7 @@ class AugMix(Algorithm):
225
225
"sharpness", and "brightness" that account for diverging effects around 0
226
226
(or 1).
227
227
228
- Default = ``"all"``.
228
+ Default: ``"all"``.
229
229
"""
230
230
231
231
# TODO document each value of augmentation_set in more detail; i.e.,
0 commit comments