albumentations-team / autoalbument

AutoML for image augmentation. AutoAlbument uses the Faster AutoAugment algorithm to find optimal augmentation policies. Documentation - https://albumentations.ai/docs/autoalbument/
https://albumentations.ai/docs/autoalbument/
MIT License
198 stars 20 forks source link

[Feature Request] Add value_range parameter to some of the policy operations for better policy control #39

Open iumyx2612 opened 2 years ago

iumyx2612 commented 2 years ago

I trained autoalbument with 11 epochs on my dataset and I think that's enough (the Average Parameter change oscillating with small amount). The output config has an augmentation with really big scale limit (around 9) and it's unusable on my dataset. So I added value_range to Scale operation like this:

class Scale(Operation):
    def __init__(self, temperature, value_range=(0 + 1e-8, 10.0)):
        super().__init__(temperature, value_range=value_range, is_spatial_level=True)

    def apply_operation(self, input, value):
        return F.scale(input, scale=value)

    def as_transform(self, value, p):
        return A.ShiftScaleRotate(
            shift_limit_x=(0, 0),
            shift_limit_y=(0, 0),
            rotate_limit=(0, 0),
            scale_limit=(value, value),
            p=p,
        )

so I can go in search.yaml to change the value of value_range