Giter Site home page Giter Site logo

Comments (17)

thu-zxs avatar thu-zxs commented on June 26, 2024

同问,最近做了finetune发现效果由逐渐变好到逐渐变差,一开始ap是小于an的并且差距逐渐变大,后来ap和an就变得接近了。

from tripletloss.

yzk0281 avatar yzk0281 commented on June 26, 2024

Hi
我用triplet finetune的时候呢 学习率取的0.005
看起来收敛还可以的样子 ap和an的差距越来越大 不过现在还没跑完
就是不知道差距到什么样子可以停止训练
还是后面会保持不变?

from tripletloss.

thu-zxs avatar thu-zxs commented on June 26, 2024

保险的话可以每隔几段iterations就存一下model,这个还真不好说,因为我跑到最后是变差的。每个人情况不同吧~对了我做的不是人脸,是印刷体汉字~

from tripletloss.

luhaofang avatar luhaofang commented on June 26, 2024

@thu-zxs 请通过最近的propsal进行finetune。
之前给的工程会出现所述的问题,个人感觉是因为梯度并没有回传,原先的model已经把距离分开来,但是由于参数的decay,造成最终参数会变0,在这个过程中会产生你所述的情况,最后变差是所有的样本输出都是0了,所以loss会为0.1

from tripletloss.

thu-zxs avatar thu-zxs commented on June 26, 2024

@pinguo-luhaofang 好的,我会继续尝试,谢谢!

from tripletloss.

luhaofang avatar luhaofang commented on June 26, 2024

@yzk0281 loss就是模型的训练收敛程度的指标啊。

from tripletloss.

yzk0281 avatar yzk0281 commented on June 26, 2024

阿。。。不会吧
我怎么看到loss值在triplet finetune的时候变化很小
但是ap和an的差距倒是逐渐增大的

from tripletloss.

luhaofang avatar luhaofang commented on June 26, 2024

@yzk0281 ap和an距离拉大了,loss不可能不会降低的

from tripletloss.

yzk0281 avatar yzk0281 commented on June 26, 2024

额。。也就是说看ap和an的差距变化也是可以的么

from tripletloss.

thu-zxs avatar thu-zxs commented on June 26, 2024

@pinguo-luhaofang
我再仔细读了一下您的代码,发现tripletselect中的backward是对不满足 aps[i][1] >= ans[i][1]的triplet反传梯度,这应该不对吧?
如理解有误,还请明示~

from tripletloss.

luhaofang avatar luhaofang commented on June 26, 2024

@thu-zxs 是的,就是对不满足aps[i][1] >= ans[i][1]的triplet反传梯度,回传满足aps[i][1] < ans[i][1]的triplet梯度。

from tripletloss.

thu-zxs avatar thu-zxs commented on June 26, 2024

嗯,方便问问其中的道理?我直观上看,不反传aps[i][1] >= ans[i][1]的样本对的梯度的话,那这个样本对不就得不到训练了?

from tripletloss.

luhaofang avatar luhaofang commented on June 26, 2024

产生梯度的是 0 < an - ap < margin 的样本对,详情请参见论文。

from tripletloss.

thu-zxs avatar thu-zxs commented on June 26, 2024

好的谢谢@pinguo-luhaofang

from tripletloss.

yzk0281 avatar yzk0281 commented on June 26, 2024

如果ap 〉 an的话 ,就是说正样本的距离比负样本还大,那样不是更应该训练么 ?

from tripletloss.

tanyuan1992 avatar tanyuan1992 commented on June 26, 2024

@yzk0281 如果aps[i][1] > ans[i][1],那么其实选出来的这个三元组是没有意义的,所以不能回传。我是这么理解的 不知道对不对

from tripletloss.

yzk0281 avatar yzk0281 commented on June 26, 2024

@tanyuan1992 为何没有意义?

from tripletloss.

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.