Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

transforms.Solarize probability is zero for transforms but not transforms_prime #35

Closed
dewball345 opened this issue Oct 16, 2021 · 3 comments

Comments

@dewball345
Copy link

I was viewing the transforms class and I saw this

        self.transform = transforms.Compose([
            transforms.RandomResizedCrop(224, interpolation=Image.BICUBIC),
            transforms.RandomHorizontalFlip(p=0.5),
            transforms.RandomApply(
                [transforms.ColorJitter(brightness=0.4, contrast=0.4,
                                        saturation=0.2, hue=0.1)],
                p=0.8
            ),
            transforms.RandomGrayscale(p=0.2),
            GaussianBlur(p=1.0),
            Solarization(p=0.0),
            transforms.ToTensor(),
            transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
        ])
        self.transform_prime = transforms.Compose([
            transforms.RandomResizedCrop(224, interpolation=Image.BICUBIC),
            transforms.RandomHorizontalFlip(p=0.5),
            transforms.RandomApply(
                [transforms.ColorJitter(brightness=0.4, contrast=0.4,
                                        saturation=0.2, hue=0.1)],
                p=0.8
            ),
            transforms.RandomGrayscale(p=0.2),
            GaussianBlur(p=0.1),
            Solarization(p=0.2),
            transforms.ToTensor(),
            transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
        ])

Notice that the solarization probability is zero on the first augmentation but not the second. Is there a difference between the two(their different naming?)

Is this expected?

@jzbontar
Copy link
Contributor

We used the same data augmentation as BYOL. They use solarization in only one of the branches.

https://github.com/deepmind/deepmind-research/blob/5f6b11299e93b0d6c6edc8e89cd1dde61495b9ae/byol/utils/augmentations.py#L50

@dewball345
Copy link
Author

dewball345 commented Oct 27, 2021 via email

@jzbontar
Copy link
Contributor

I didn't run that experiment so I can't really say, sorry.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants