GithubHelp home page GithubHelp logo

Comments (7)

huanghoujing avatar huanghoujing commented on July 2, 2024

多谢您的关注!

这里global和local的矩阵都可以拿来做mutual learning,可以选择性用哪一个,参见这里这里

from alignedreid-re-production-pytorch.

Phoebe-star avatar Phoebe-star commented on July 2, 2024

hi , do you know what is the zero gradient in the paper (3) ?

and your code in the train_ml.py , line 519

Global Distance Mutual Loss (L2 Loss)

  gdm_loss = 0
  if (cfg.num_models > 1) and (cfg.gdm_loss_weight > 0):
    for j in range(cfg.num_models):
      if j != i:
        gdm_loss += torch.sum(torch.pow(
          g_dist_mat - TVT(g_dist_mat_list[j]).detach(), 2))
    gdm_loss /= 1. * (cfg.num_models - 1) * len(ims) * len(ims)

I can't understand " g_dist_mat" and " TVT(g_dist_mat_list[j]).detach()" .
if the "TVT(g_dist_mat_list[j]).detach() " is the zero gradient , than what do you do ?
thanks

from alignedreid-re-production-pytorch.

huanghoujing avatar huanghoujing commented on July 2, 2024

Hi, yes, detach is my understanding of zero gradient in the paper. When .detach() is applied to a Variable, it returns a new Variable that is a leaf node and stops gradients through itself.

from alignedreid-re-production-pytorch.

Phoebe-star avatar Phoebe-star commented on July 2, 2024

could you explain again with 中文? what is the zero gradient ?
thanks you

from alignedreid-re-production-pytorch.

huanghoujing avatar huanghoujing commented on July 2, 2024

我理解的zero gradient的意思是梯度传到那里就不往下传了,所以这里可以用Variable的detach method来实现。

from alignedreid-re-production-pytorch.

Phoebe-star avatar Phoebe-star commented on July 2, 2024

this is mean the mutual loss don't backpropagation, only metric loss do backpropagation

from alignedreid-re-production-pytorch.

michuanhaohao avatar michuanhaohao commented on July 2, 2024

@Phoebe-star 你好,我是论文一作,zero grad是指把这个变量当常数来看,原版论文使用了megvii的框架,Pytorch没有这个operator,Pytorch可以用detach来实现

from alignedreid-re-production-pytorch.

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.