@@ -584,22 +584,22 @@ def __repr__(self):
584
584
585
585
586
586
def auto_augment_transform (config_str : str , hparams : Optional [Dict ] = None ):
587
- """
588
- Create a AutoAugment transform
587
+ """ Create a AutoAugment transform
589
588
590
589
Args:
591
590
config_str: String defining configuration of auto augmentation. Consists of multiple sections separated by
592
591
dashes ('-').
593
592
The first section defines the AutoAugment policy (one of 'v0', 'v0r', 'original', 'originalr').
594
-
595
- The remaining sections:
596
- 'mstd' - float std deviation of magnitude noise applied
597
- Ex 'original-mstd0.5' results in AutoAugment with original policy, magnitude_std 0.5
598
-
593
+ While the remaining sections define other arguments
594
+ * 'mstd' - float std deviation of magnitude noise applied
599
595
hparams: Other hparams (kwargs) for the AutoAugmentation scheme
600
596
601
597
Returns:
602
598
A PyTorch compatible Transform
599
+
600
+ Examples::
601
+
602
+ 'original-mstd0.5' results in AutoAugment with original policy, magnitude_std 0.5
603
603
"""
604
604
config = config_str .split ('-' )
605
605
policy_name = config [0 ]
@@ -764,27 +764,30 @@ def rand_augment_transform(
764
764
hparams : Optional [Dict ] = None ,
765
765
transforms : Optional [Union [str , Dict , List ]] = None ,
766
766
):
767
- """
768
- Create a RandAugment transform
767
+ """ Create a RandAugment transform
769
768
770
769
Args:
771
770
config_str (str): String defining configuration of random augmentation. Consists of multiple sections separated
772
771
by dashes ('-'). The first section defines the specific variant of rand augment (currently only 'rand').
773
- The remaining sections, not order sepecific determine
774
- 'm' - integer magnitude of rand augment
775
- 'n' - integer num layers (number of transform ops selected per image)
776
- 'p' - float probability of applying each layer (default 0.5)
777
- 'mstd' - float std deviation of magnitude noise applied, or uniform sampling if infinity (or > 100)
778
- 'mmax' - set upper bound for magnitude to something other than default of _LEVEL_DENOM (10)
779
- 'inc' - integer (bool), use augmentations that increase in severity with magnitude (default: 0)
780
- 't' - str name of transform set to use
781
- Ex 'rand-m9-n3-mstd0.5' results in RandAugment with magnitude 9, num_layers 3, magnitude_std 0.5
782
- 'rand-mstd1-tweights' results in mag std 1.0, weighted transforms, default mag of 10 and num_layers 2
783
-
772
+ The remaining sections, not order specific determine
773
+ * 'm' - integer magnitude of rand augment
774
+ * 'n' - integer num layers (number of transform ops selected per image)
775
+ * 'p' - float probability of applying each layer (default 0.5)
776
+ * 'mstd' - float std deviation of magnitude noise applied, or uniform sampling if infinity (or > 100)
777
+ * 'mmax' - set upper bound for magnitude to something other than default of _LEVEL_DENOM (10)
778
+ * 'inc' - integer (bool), use augmentations that increase in severity with magnitude (default: 0)
779
+ * 't' - str name of transform set to use
784
780
hparams (dict): Other hparams (kwargs) for the RandAugmentation scheme
785
781
786
782
Returns:
787
783
A PyTorch compatible Transform
784
+
785
+ Examples::
786
+
787
+ 'rand-m9-n3-mstd0.5' results in RandAugment with magnitude 9, num_layers 3, magnitude_std 0.5
788
+
789
+ 'rand-mstd1-tweights' results in mag std 1.0, weighted transforms, default mag of 10 and num_layers 2
790
+
788
791
"""
789
792
magnitude = _LEVEL_DENOM # default to _LEVEL_DENOM for magnitude (currently 10)
790
793
num_layers = 2 # default to 2 ops per image
0 commit comments