Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the Fourier transform of causality intervention module #5

Open
ABBlankSpace opened this issue Aug 11, 2022 · 1 comment
Open

Comments

@ABBlankSpace
Copy link

Hi author, thank you for your excellent work.
I have a question about the paper and code. The Causal Intervention Module in the paper says that $x^a$ is obtained by using Fourier transform, but in your code, I see the data transformation in the below function, which seems to be not Fourier transform. I am not an expert in the image field, so I have some doubts about this. In addition, I have not seen the paper in the data transformation λ~U(0,η) either.

def get_pre_transform(image_size=224, crop=False, jitter=0):
    if crop:
        img_transform = [transforms.RandomResizedCrop(image_size, scale=[0.8, 1.0])]
    else:
        img_transform = [transforms.Resize((image_size, image_size))]
    if jitter > 0:
        img_transform.append(transforms.ColorJitter(brightness=jitter,
                                                    contrast=jitter,
                                                    saturation=jitter,
                                                    hue=min(0.5, jitter)))
    img_transform += [transforms.RandomHorizontalFlip(), lambda x: np.asarray(x)]
    img_transform = transforms.Compose(img_transform)
    return img_transform

Looking forward to your reply.

@feimo49
Copy link
Collaborator

feimo49 commented Sep 3, 2022

The function you mentioned above is just a common technique used to pre-process the images. As for the Fourier transformation, you can refer to class FourierDGDataset() in Line 32 in data/DGDataReader.py. Thanks for your interest.

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

No branches or pull requests

2 participants