Coder Social home page Coder Social logo

Comments (8)

woctezuma avatar woctezuma commented on July 21, 2024 1

Implementation of GSA in the code is from:

Based on lucidrains' repository, one could refer to this for prior work:

Efficient attention is an attention mechanism that substantially optimizes the memory and computational efficiency while retaining exactly the same expressive power as the conventional dot-product attention.

Apparently, it is a cheaper way to have attention.
It brings attention mechanism to the model, but does not increase its size a lot because it does not add new features, etc.

from lightweight-gan.

Mut1nyJD avatar Mut1nyJD commented on July 21, 2024

Yes using attention does improve quality at least reflected in the FID scores they tend to go lower.
Tradeoff is larger more memory usage and longer training time.

from lightweight-gan.

Dok11 avatar Dok11 commented on July 21, 2024

What is better? Change [32] to [96] or [32,64]? What is the different?

from lightweight-gan.

woctezuma avatar woctezuma commented on July 21, 2024

What is better? Change [32] to [96] or [32,64]? What is the different?

I think it should be a power of 2, so 96 would not be valid.

for (res, (chan_in, chan_out)) in zip(self.res_layers, in_out_features):
image_width = 2 ** res
attn = None
if image_width in attn_res_layers:
attn = Rezero(GSA(dim = chan_in, norm_queries = True))

from lightweight-gan.

Dok11 avatar Dok11 commented on July 21, 2024

Of course, but my question about different beween one large value vs. two smaller values

from lightweight-gan.

Mut1nyJD avatar Mut1nyJD commented on July 21, 2024

@Dok11 I think you are misunderstanding the value, it puts multiple attention layers at the resolutions you specify into the neural network graph, so at more resolutions the better of course as you'll get attention at different levels. It's the same as convolutions. If you can only effort one it depends on your training data has it lot of global structure (then lower resolution layer is beneficial) or lot of local structure (then a higher resolution layer is more beneficial)

from lightweight-gan.

Dok11 avatar Dok11 commented on July 21, 2024

I thought same but I hoped someone can help me with some examples with this values.
For example, for some purpose we use param is [32], for other purpose/images we use params if [8,16,32,64].
Maybe have reason to create some synthetic dataset to test this parameters in practice? Like this:
image

from lightweight-gan.

Dok11 avatar Dok11 commented on July 21, 2024

@Mut1nyJD I still not undrestanding attn layers, but I think have reasonable question. By changing attn-res-layers from [32] to [32,64,128,256] the model file size does not increase more then two megabytes. So does it really must improve quality?
Yes, model trainig requires more memory and time. So I confused, trainig slower, but model size still same size (almost). I think it mean that model doesnt increse own possibilities. How model will make more detailed images with same size..
If you know some sources with simple description of this technique let me know please.

from lightweight-gan.

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.