Skip to content

Commit

Permalink
Removing default value to the num_classes parameter and set to the nu…
Browse files Browse the repository at this point in the history
…mber of classes in the dataset.

PiperOrigin-RevId: 565723796
  • Loading branch information
tensorflower-gardener committed Sep 15, 2023
1 parent aeaf149 commit 1900bc5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions official/vision/ops/augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2628,15 +2628,17 @@ class MixupAndCutmix:
"""

def __init__(self,
num_classes: int,
mixup_alpha: float = .8,
cutmix_alpha: float = 1.,
prob: float = 1.0,
switch_prob: float = 0.5,
label_smoothing: float = 0.1,
num_classes: int = 1001):
label_smoothing: float = 0.1):
"""Applies Mixup and/or Cutmix to a batch of images.
Args:
num_classes (int): Number of classes.
mixup_alpha (float, optional): For drawing a random lambda (`lam`) from a
beta distribution (for each image). If zero Mixup is deactivated.
Defaults to .8.
Expand All @@ -2648,7 +2650,6 @@ def __init__(self,
batch. Defaults to 0.5.
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.cutmix_alpha = cutmix_alpha
Expand Down

0 comments on commit 1900bc5

Please sign in to comment.