Skip to content

Commit 8c6e224

Browse files
nabenabe0928ravinkohli
authored andcommitted
[doc] Add referencing to each regularization techniques
1 parent 7e8ab5e commit 8c6e224

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

autoPyTorch/pipeline/components/training/trainer/AdversarialTrainer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121

2222

2323
class AdversarialTrainer(BaseTrainerComponent):
24+
"""
25+
References:
26+
Title: Explaining and Harnessing Adversarial Examples
27+
Authors: Ian J. Goodfellow et. al.
28+
URL: https://arxiv.org/pdf/1412.6572.pdf
29+
Github URL: https://pytorch.org/tutorials/beginner/fgsm_tutorial.html#fgsm-attack
30+
"""
2431
def __init__(
2532
self,
2633
epsilon: float,
@@ -37,11 +44,7 @@ def __init__(
3744
3845
Args:
3946
epsilon (float): The perturbation magnitude.
40-
41-
References:
42-
Explaining and Harnessing Adversarial Examples
43-
Ian J. Goodfellow et. al.
44-
https://arxiv.org/pdf/1412.6572.pdf
47+
4548
"""
4649
super().__init__(random_state=random_state,
4750
weighted_loss=weighted_loss,
@@ -129,9 +132,6 @@ def fgsm_attack(
129132
130133
Returns:
131134
adv_data (np.ndarray): the adversarial examples.
132-
133-
References:
134-
https://pytorch.org/tutorials/beginner/fgsm_tutorial.html#fgsm-attack
135135
"""
136136
data_copy = deepcopy(data)
137137
data_copy = data_copy.float().to(self.device)

autoPyTorch/pipeline/components/training/trainer/GridCutMixTrainer.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010

1111
class GridCutMixTrainer(MixUp, BaseTrainerComponent):
12+
""" # noqa
13+
References:
14+
Title: CutMix: Regularization Strategy to Train Strong Classifiers
15+
with Localizable Features
16+
Authors: Sangdoo Yun et. al.
17+
URL: https://openaccess.thecvf.com/content_ICCV_2019/papers/Yun_CutMix_Regularization_Strategy_to_Train_Strong_Classifiers_With_Localizable_Features_ICCV_2019_paper.pdf
18+
Github URL: https://github.com/clovaai/CutMix-PyTorch/blob/master/train.py#L227-L244
19+
"""
1220

1321
def data_preparation(self, X: np.ndarray, y: np.ndarray,
1422
) -> typing.Tuple[np.ndarray, typing.Dict[str, np.ndarray]]:

autoPyTorch/pipeline/components/training/trainer/GridCutOutTrainer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88

99
class GridCutOutTrainer(CutOut, BaseTrainerComponent):
10+
"""
11+
References:
12+
Title: Improved Regularization of Convolutional Neural Networks with Cutout
13+
Authors: Terrance DeVries and Graham W. Taylor
14+
URL: https://arxiv.org/pdf/1708.04552.pdf
15+
Github URL: https://github.com/hysts/pytorch_cutout/blob/master/dataloader.py#L36-L68
16+
"""
1017

1118
def data_preparation(self, X: np.ndarray, y: np.ndarray,
1219
) -> typing.Tuple[np.ndarray, typing.Dict[str, np.ndarray]]:

autoPyTorch/pipeline/components/training/trainer/RowCutOutTrainer.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010

1111
class RowCutOutTrainer(CutOut, BaseTrainerComponent):
12+
"""
13+
References:
14+
Title: Improved Regularization of Convolutional Neural Networks with Cutout
15+
Authors: Terrance DeVries and Graham W. Taylor
16+
URL: https://arxiv.org/pdf/1708.04552.pdf
17+
Github URL: https://github.com/hysts/pytorch_cutout/blob/master/dataloader.py#L36-L68
18+
"""
19+
1220
# 0 is non-informative in image data
1321
NUMERICAL_VALUE = 0
1422
# -1 is the conceptually equivalent to 0 in a image, i.e. 0-pad

autoPyTorch/pipeline/components/training/trainer/mixup_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818

1919

2020
class MixUp:
21+
"""
22+
References:
23+
Title: mixup: Beyond Empirical Risk Minimization
24+
Authors: Hougyi Zhang et. al.
25+
URL: https://arxiv.org/pdf/1710.09412.pdf%C2%A0
26+
Github URL: https://github.com/facebookresearch/mixup-cifar10/blob/master/train.py#L119-L138
27+
"""
2128
def __init__(self, alpha: float,
2229
weighted_loss: bool = False,
2330
random_state: Optional[np.random.RandomState] = None,

0 commit comments

Comments
 (0)