Git Product home page Git Product logo

Comments (4)

seusofthd avatar seusofthd commented on June 12, 2024

And for implementing the Sparse version, it should be equivalent to changing the y_true to one hot labels and then directly apply the CircleLoss class's call, is that correct?

from circle-loss.

zhen8838 avatar zhen8838 commented on June 12, 2024
  1. for image classification:
    I use code as following ensure y_pred as cos similarity.
      kl.Lambda(lambda x: tf.nn.l2_normalize(x, 1), name='emmbeding'),
      kl.Dense(10, use_bias=False, kernel_constraint=k.constraints.unit_norm())
  1. yse, But if k > 1, SparseCircleLoss is actually equivalent to PairCircleLoss

  2. yes.

from circle-loss.

seusofthd avatar seusofthd commented on June 12, 2024

Thanks for your quick reply!

for 2 if K >1 I still have some questions. Basically it is a sum of exp(-gamma...s_p...). This means that you cannot take the sum of positive exps as the denominator. So you cannot just use
-r_sp_m * self.gamma + logZ
as the denominator inside the log.
And imagine that we can have two pairs of positive, then r_sp_m's dimension would be [batch_size, 2],
which is different fro logZ(dimension is [batch_size, 1])

And for training the cifar, how did you schedule the learning rate, you just use the default lr in Adam?
I am trying to implement this for resnet50 training on imagenet, seems it is very sensitive to learning rate.

from circle-loss.

zhen8838 avatar zhen8838 commented on June 12, 2024

I think that the optimization goal set by circle loss cannot be achieved, so his loss gradient will be quite large. At the same time, the ap and an is very large due to the large gap during the first few training cycles.

But overall the circle loss is still relatively robust, I suggest that the pre-training is best to reduce the learning rate by 10 times

from circle-loss.

Related Issues (7)

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.