@@ -88,16 +88,18 @@ def __call__(self, data: torch.Tensor, labels: torch.Tensor | None = None):
88
88
89
89
class CutMix (Mixer ):
90
90
"""CutMix augmentation as described in:
91
- Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, Youngjoon Yoo.
92
- CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features,
93
- ICCV 2019
91
+ Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, Youngjoon Yoo.
92
+ CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features,
93
+ ICCV 2019
94
94
95
- Class derived from :py:class:`monai.transforms.Mixer`. See corresponding
96
- documentation for details on the constructor parameters. Here, alpha not only determines
97
- the mixing weight but also the size of the random rectangles used during for mixing.
98
- Please refer to the paper for details.
95
+ Class derived from :py:class:`monai.transforms.Mixer`. See corresponding
96
+ documentation for details on the constructor parameters. Here, alpha not only determines
97
+ the mixing weight but also the size of the random rectangles used during for mixing.
98
+ Please refer to the paper for details.
99
99
100
- The most common use case is something close to:
100
+ The most common use case is something close to:
101
+
102
+ .. code-block:: python
101
103
102
104
cm = CutMix(batch_size=8, alpha=0.5)
103
105
for batch in loader:
@@ -106,6 +108,7 @@ class CutMix(Mixer):
106
108
output = model(augimg)
107
109
loss = loss_function(output, auglabels)
108
110
...
111
+
109
112
"""
110
113
111
114
def apply (self , data : torch .Tensor ):
0 commit comments