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

Query regarding input transformation #13

Closed
Viresh-R opened this issue May 12, 2018 · 3 comments
Closed

Query regarding input transformation #13

Viresh-R opened this issue May 12, 2018 · 3 comments

Comments

@Viresh-R
Copy link

Viresh-R commented May 12, 2018

Hey,
I guess input and ema_input transformed versions of the same images, right ?(

for i, ((input, ema_input), target) in enumerate(train_loader):
)

If so, did you guys experiment with using the same input for both model and ema_model ? Does using the same input lead to drop in performance ?

Thanks !

@tarvaina
Copy link
Contributor

Hi!

At that point in code the noise has been already applied. The input and ema_input incorporate different samples from the same noise distribution.

For example, the CIFAR-10 image translations are drawn from uniform distribution [-4, 4] on both axes. Thus, on line 208, an individual image in input might have been translated two pixels to the left whereas the corresponding image in ema_input might be one pixel up and three pixels left.

We did not experiment using the same noise on both sides. You can explore it yourself if you want to by moving the image augmentation steps before TransformTwice in PyTorch code here:

train_transformation = data.TransformTwice(transforms.Compose([
data.RandomTranslateWithReflect(4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(**channel_stats)
]))

Please let us know what happens if you end up running this experiment. I have been wondering about it and meant to do it but never actually did.

@tarvaina
Copy link
Contributor

So something like:

train_transformation = transforms.Compose([
    data.RandomTranslateWithReflect(4), 
    transforms.RandomHorizontalFlip(), 
    data.TransformTwice(transforms.Compose([ 
        transforms.ToTensor(), 
        transforms.Normalize(**channel_stats) 
    ])
]) 

@Viresh-R
Copy link
Author

Thanks for your reply ! I will let you know if I end up doing the experiment.

I would think that the performance of Mean Teacher won't drop drastically, since the teacher and student output would still be very different, as the parameters of the two nets are very different. Perhaps approaches like Pi-model(https://arxiv.org/pdf/1610.02242.pdf) would suffer more( where input transformation and dropout are the only sources of variability).

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