CIRL icon indicating copy to clipboard operation
CIRL copied to clipboard

About the Fourier transform of causality intervention module

Open ABBlankSpace opened this issue 3 years ago • 1 comments

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.

ABBlankSpace avatar Aug 11 '22 12:08 ABBlankSpace

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.

feimo49 avatar Sep 03 '22 03:09 feimo49