Commit f2e1a77e authored by Ron Shapiro's avatar Ron Shapiro Committed by A. Unique TensorFlower
Browse files

Fix `Args:` formatting so that the doc generator will properly render the list of arguments.

PiperOrigin-RevId: 456426797
parent 9ef7d76e
...@@ -2075,29 +2075,25 @@ class RandomErasing(ImageAugment): ...@@ -2075,29 +2075,25 @@ class RandomErasing(ImageAugment):
min_area: float = 0.02, min_area: float = 0.02,
max_area: float = 1 / 3, max_area: float = 1 / 3,
min_aspect: float = 0.3, min_aspect: float = 0.3,
max_aspect=None, max_aspect: Optional[float] = None,
min_count=1, min_count=1,
max_count=1, max_count=1,
trials=10): trials=10):
"""Applies RandomErasing to a single image. """Applies RandomErasing to a single image.
Args: Args:
probability (float, optional): Probability of augmenting the image. probability: Probability of augmenting the image. Defaults to `0.25`.
Defaults to 0.25. min_area: Minimum area of the random erasing rectangle. Defaults to
min_area (float, optional): Minimum area of the random erasing rectangle. `0.02`.
Defaults to 0.02. max_area: Maximum area of the random erasing rectangle. Defaults to `1/3`.
max_area (float, optional): Maximum area of the random erasing rectangle. min_aspect: Minimum aspect rate of the random erasing rectangle. Defaults
Defaults to 1/3. to `0.3`.
min_aspect (float, optional): Minimum aspect rate of the random erasing max_aspect: Maximum aspect rate of the random erasing rectangle. Defaults
rectangle. Defaults to 0.3. to `None`.
max_aspect ([type], optional): Maximum aspect rate of the random erasing min_count: Minimum number of erased rectangles. Defaults to `1`.
rectangle. Defaults to None. max_count: Maximum number of erased rectangles. Defaults to `1`.
min_count (int, optional): Minimum number of erased rectangles. Defaults trials: Maximum number of trials to randomly sample a rectangle that
to 1. fulfills constraint. Defaults to `10`.
max_count (int, optional): Maximum number of erased rectangles. Defaults
to 1.
trials (int, optional): Maximum number of trials to randomly sample a
rectangle that fulfills constraint. Defaults to 10.
""" """
self._probability = probability self._probability = probability
self._min_area = float(min_area) self._min_area = float(min_area)
...@@ -2205,18 +2201,15 @@ class MixupAndCutmix: ...@@ -2205,18 +2201,15 @@ class MixupAndCutmix:
"""Applies Mixup and/or Cutmix to a batch of images. """Applies Mixup and/or Cutmix to a batch of images.
Args: Args:
mixup_alpha (float, optional): For drawing a random lambda (`lam`) from a mixup_alpha: For drawing a random lambda (`lam`) from a beta distribution
beta distribution (for each image). If zero Mixup is deactivated. (for each image). If zero Mixup is deactivated. Defaults to `.8`.
Defaults to .8. cutmix_alpha: For drawing a random lambda (`lam`) from a beta distribution
cutmix_alpha (float, optional): For drawing a random lambda (`lam`) from a (for each image). If zero Cutmix is deactivated. Defaults to `1.`.
beta distribution (for each image). If zero Cutmix is deactivated. prob: Of augmenting the batch. Defaults to `1.0`.
Defaults to 1.. switch_prob: Probability of applying Cutmix for the batch. Defaults to
prob (float, optional): Of augmenting the batch. Defaults to 1.0. `0.5`.
switch_prob (float, optional): Probability of applying Cutmix for the label_smoothing: Constant for label smoothing. Defaults to `0.1`.
batch. Defaults to 0.5. num_classes: Number of classes. Defaults to `1001`.
label_smoothing (float, optional): Constant for label smoothing. Defaults
to 0.1.
num_classes (int, optional): Number of classes. Defaults to 1001.
""" """
self.mixup_alpha = mixup_alpha self.mixup_alpha = mixup_alpha
self.cutmix_alpha = cutmix_alpha self.cutmix_alpha = cutmix_alpha
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment