Code Monkey home page Code Monkey logo

Comments (4)

filaPro avatar filaPro commented on September 26, 2024

Hi @Antinomy20001,

Yes this function is a little bit tricky. The thing is that during one training step we need to pass 1 source and 2 target batches throw the same model. The sum of these 3 batch sizes doesn't allow us to pass them throw the model simultaneously due to the GPU memory limit. So we call the model 3 times. But here we are going to have troubles with BatchNorm statistics as they are not the same for source and target domains. This makes training process slower and much more unstable. The solution here is to form 3 batches with 1/3 of source images and 2/3 of target images in each of them.

Also, as I remember it is not our novelty, and we follow one of the open sourced pytorch implementations.

from visda2019.

Antinomy20001 avatar Antinomy20001 commented on September 26, 2024

Hi @Antinomy20001,

Yes this function is a little bit tricky. The thing is that during one training step we need to pass 1 source and 2 target batches throw the same model. The sum of these 3 batch sizes doesn't allow us to pass them throw the model simultaneously due to the GPU memory limit. So we call the model 3 times. But here we are going to have troubles with BatchNorm statistics as they are not the same for source and target domains. This makes training process slower and much more unstable. The solution here is to form 3 batches with 1/3 of source images and 2/3 of target images in each of them.

Also, as I remember it is not our novelty, and we follow one of the open sourced pytorch implementations.

Thanks for your rapid response! In fact, I am migrating your code to Pytorch, hahaha...😜.

Is this transpose operation to make BatchNorm's running_mean and running_var more stable? So call the function balanced? I think I have got it.

from visda2019.

filaPro avatar filaPro commented on September 26, 2024

Yes, you are right.

from visda2019.

Antinomy20001 avatar Antinomy20001 commented on September 26, 2024

Thanks again for your response and help

from visda2019.

Related Issues (1)

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.