GithubHelp home page GithubHelp logo

Comments (7)

xinntao avatar xinntao commented on May 7, 2024

self._dequeue_and_enqueue()

This line will call _dequeue_and_enqueue

from real-esrgan.

YangGangZhiQi avatar YangGangZhiQi commented on May 7, 2024

@xinntao Yes, this line call self._dequeue_and_enqueue(). I just cannot figure out how your code use self.queue_lq and self.queue_gt . I cannot find some other codes to use this two member variables。I know the role of this code block is to put input data in training pool. How does the code reach this goal?

from real-esrgan.

xinntao avatar xinntao commented on May 7, 2024

image

  1. It first randomly shuffle the image in the pool
  2. then get first N samples for self.lq and self.gt
  3. Finally, we obtain the shuffled self.lq and self.gt

from real-esrgan.

YangGangZhiQi avatar YangGangZhiQi commented on May 7, 2024

I get it. Thanks for your patient explain! So poor my understanding about the _dequeue_and_enqueue function!

from real-esrgan.

Arseny-N avatar Arseny-N commented on May 7, 2024

Hi, @xinntao. Thank you for the awesome work !

I also somewhat do not understand the purpose of this function.
Why do we need to sample the training batch from a pool of images ?

As far as I can tell the most obvious reason is to avoid creating a batch
from sequential indices. But we already shuffle the indices in EnlargedSampler.
So the batch will not be sequential.

On the other hand the shuffling may result in some samples being used more
then once. Is this a technique for improving training ?

Thanks in advance,
Arseny

from real-esrgan.

xinntao avatar xinntao commented on May 7, 2024

@Arseny-N
Batch processing in pytorch limits the diversity of synthetic degradations in a batch. For example, samples in a batch could not have different resize scaling factors. Therefore, we employ a training pair pool to increase the degradation diversity in a batch.

from real-esrgan.

Arseny-N avatar Arseny-N commented on May 7, 2024

Thank you for the timely explanation!

from real-esrgan.

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.