Giter VIP home page Giter VIP logo

Comments (14)

david-berthelot avatar david-berthelot commented on June 3, 2024
  1. We use the Brier score (MSE loss) to make the training more robust to incorrect guesses. This is detailed in the paper on arxiv.
  2. You could use a big batch. Just be mindful that with training=True the batch size must always be the same for batch_norm to behave properly. In particular, we run the model in guess_labels (on u1, u2) and we run it in the main body again (on x', u1', u2'). That's why we ended up running each group (x', u1, u2, u1', u2') separately since combining them would result in two mismatched batches.

from mixmatch.

CoinCheung avatar CoinCheung commented on June 3, 2024

In the settings of this code base, there are 5 forward computations per iteration: 2 for label guessing on u1 and u2, and 3 on the mixed input. All of these 5 forward computations would affect the running mean/var status of bn layers, though computation on u1 and u2 are not meant for training. Would it be better if we find a way to remove the impact on bn status brought by u1 and u2?

from mixmatch.

david-berthelot avatar david-berthelot commented on June 3, 2024

Actually only one forward computation affects the batch norm running mean and var. We explicitly make sure of that in the code by shuffling the batches contents (layers.interleave) and by ignoring the global updates (see post_ops) other than for that one batch.

from mixmatch.

CoinCheung avatar CoinCheung commented on June 3, 2024

Thanks, I will try it.

from mixmatch.

HeimingX avatar HeimingX commented on June 3, 2024

Just be mindful that with training=True the batch size must always be the same for batch_norm to behave properly.

Hi, thank you for your in-depth discussion. With regard to the statement above, I wonder is there any literature shows that it is best to ensure that the batch sizes are consistent for infering through the model during one batch iteration?

from mixmatch.

david-berthelot avatar david-berthelot commented on June 3, 2024

I am not sure about literature on the topic. It's just that with different batches sizes, I would expect the variance to change. So basically I erred on the safe side in the code. But feel free to experiment may it can be simplified.

from mixmatch.

HeimingX avatar HeimingX commented on June 3, 2024

Thanks for reply.

from mixmatch.

HeimingX avatar HeimingX commented on June 3, 2024

Hi, I have one more question about the CIFAR100 experiment.
In your paper, a 28-layer Wide Resnet model (which has 135 filters per layer, resulting in 26 million parameters) is used for CIFAR100. According to the tutorial in readme file, I just set the parameter filter equals to 135 and the code shows that total number of parameter is 25,985,290. I also notice that the filter number of the first conv layer(filter=16) is fixed in your ResNet class . so I wonder if this setup is the same as yours for getting the results in your paper. Thanks.

from mixmatch.

david-berthelot avatar david-berthelot commented on June 3, 2024

Yes it is the same setup. In reality we had a little bit less parameters than the methods we compared to, so yes the number is correct it's almost 26M.

from mixmatch.

HeimingX avatar HeimingX commented on June 3, 2024

Thanks

from mixmatch.

CoinCheung avatar CoinCheung commented on June 3, 2024

Hi,
Thanks for these replies, I am not familiar with tensorflow, so I feel maybe I better ask a bit more about the details :)

Did you use a batch of 64 interleaved samples to train the model with the other 128 samples neglected in computing the gradients of all parameters (or only use 64 samples to update bn, and use all the 192 samples to update other parameters)? If only 64 samples are used on all parameters, since I want to try a big batch of 192 samples per forward computation, should I multiply the learning rate by 3? As for the number of epoches and iterations, you trained with batch size of 64 for 1024 epoches and with each epoch consists of 1024 iterations, so if I train with 192 samples per iteration, I should reduce the number of iterations per epoch to 1024/3, am I correct ?

from mixmatch.

david-berthelot avatar david-berthelot commented on June 3, 2024

All batches (192 samples) are used in gradient computation.

from mixmatch.

lichunlei111 avatar lichunlei111 commented on June 3, 2024

Hello, I am very inspired to read your thesis, but when I run the code, I find that the code is missing files. Can you send me the complete code? Appreciate it!

from mixmatch.

david-berthelot avatar david-berthelot commented on June 3, 2024

I'm closing this issue since I answered the original question. For unrelated questions, please open new issues.

from mixmatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.