Giter Club home page Giter Club logo

Comments (3)

yangcedrus avatar yangcedrus commented on July 26, 2024

你好,这种在计算损失之前在距离上乘以一个数,就是有些方法会用的温度。

这些方法会用温度来控制距离分布的熵。乘上0.01后,pytorch实际进行交叉熵计算的是经过softmax的tensor。softmax的结果会受到温度影响,但是和不用温度结果相比,不会有数量级或者大小关系的变化,只会使得每个类分类结果的分布平缓或者尖锐。

你所做的乘以0.01,就是使用值为100的温度。至于温度对方法的影响,这个对不同的方法是不同的,因此准确率提升或者下降都是有可能的。

from libfewshot.

ch-control avatar ch-control commented on July 26, 2024

感谢回复,那我可不可以理解为距离的数量级对模型最终的准确率会有影响,那么假如我对距离度量进行了改进导致最终距离的数量级变小,我怎么能够确定最终模型准确率的提升是因为我的改进方法还是因为数量级的变化?

from libfewshot.

yangcedrus avatar yangcedrus commented on July 26, 2024

由于计算交叉熵之前需要先使用softmax对距离进行处理,因此乘上系数不能简单理解为改变了距离的数量级,系数最主要的所用是改变softmax的输出分布。

如果是只是对ProtoNet的欧式距离乘上这种系数,并不能称得上是对距离度量的改进,而是在距离上应用了温度这个技巧。
如果是对其他你所提出的距离度量进行分析,需要进行消融,尝试去掉温度或者换一个带相同温度的其他度量来进行消融实验,以此来验证是温度还是距离度量的作用。
深度学习中的temperature parameter
交叉熵的计算

from libfewshot.

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.