Giter Site home page Giter Site logo

关于NormHead的疑问 about baichuan2 HOT 7 OPEN

piekey1994 avatar piekey1994 commented on May 22, 2024 2
关于NormHead的疑问

from baichuan2.

Comments (7)

mmmans avatar mmmans commented on May 22, 2024

You are right. creating new parameter in eval mode is just a speedup trick! You can use norm_weight = nn.functional.normalize(self.weight) for all mode, no harm except a little bit slowness.

from baichuan2.

FrankWhh avatar FrankWhh commented on May 22, 2024

请问为啥重新赋值能加速?

from baichuan2.

mmmans avatar mmmans commented on May 22, 2024

请问为啥重新赋值能加速?

Normalization is omitted in this case.

from baichuan2.

FrankWhh avatar FrankWhh commented on May 22, 2024

有相关资料吗?我理解推理就是前项计算,融合算子可以加速,重新赋值为啥能加速

from baichuan2.

jameswu2014 avatar jameswu2014 commented on May 22, 2024

有相关资料吗?我理解推理就是前项计算,融合算子可以加速,重新赋值为啥能加速

只有第一次forward会计算,后面就直接赋值了,不需要再对weight做normalize了

from baichuan2.

jeffchy avatar jeffchy commented on May 22, 2024

发现多次eval loss的时候损失很大,是否是因为当eval的时候,weight会被重新赋值,但是如果我在训练过程中连续eval,是不是会有问题?

from baichuan2.

David-Lee-1990 avatar David-Lee-1990 commented on May 22, 2024

发现多次eval loss的时候损失很大,是否是因为当eval的时候,weight会被重新赋值,但是如果我在训练过程中连续eval,是不是会有问题?

训练过程中多次eval,并不会每次都重新赋值吧,只是第一次eval的时候。

from baichuan2.

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.