GithubHelp home page GithubHelp logo

Comments (6)

sayakpaul avatar sayakpaul commented on May 25, 2024

I think we can now separate out the modules (multi-crop augmentation pipeline and the architecture) in .py files and import them in Colab directly to make it a bit less-lengthy. This is just a suggestion and I know the notebook under consideration is just for a dry run.

from swav-tf.

ayulockin avatar ayulockin commented on May 25, 2024

Are you meaning that the logits and labels in criterion will be swapped? If so, how?

Currently computing subloss like this: subloss -= criterion(labels=q, logits=p_unscaled)

The criterion here will be tf.nn.softmax_cross_entropy_with_logits in my opinion. The choice of labels and logits here is coming from the assumption that we are learning to predict the code from the assigned cluster. If this assumption is flawed then labels will be p_unscaled and logits will be q.

I think it might be even better to just replicate the following as the authors have done in here. What do you think?

Yes replicating this would be better. It's much more readable.

from swav-tf.

ayulockin avatar ayulockin commented on May 25, 2024

Two normalizations. First, they normalize the embeddings they get from the RN50 backbone, then they pass it through a linear layer (prototype). While training they again normalize this prototype vector.

It seems so. The first normalization is done in the forward_head (here) and they are taking the weights and normalizing it before the start of each epoch (here).

But in the first normalization it's normalizing the embedding(128 vector) and in the second they are normalizing the weights from the "prototype" layer.

(Wrote this so that we are on same page and if I am mistaken then seeking correction.)

from swav-tf.

sayakpaul avatar sayakpaul commented on May 25, 2024

Right on both the fronts!

from swav-tf.

ayulockin avatar ayulockin commented on May 25, 2024

Great.

We need to trace what is non-trainable and what is. In the main SwAV code, all the variables with no_grad tag are basically non-trainable.

I might need some help here.

from swav-tf.

sayakpaul avatar sayakpaul commented on May 25, 2024

@ayulockin we can accomplish this using the following options I assume:

  • Explicitly specify which variables to track for gradient computation from the graph. GradientTape has got a watch function that allows us to do this.
  • We can put a code block outside of the GradientTape context so that no gradient gets calculated in the first place.
  • Use tf.stop_gradient as necessary.

But we will figure out more as we proceed.

from swav-tf.

Related Issues (9)

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.