GithubHelp home page GithubHelp logo

关于一个细节的问题 about mst HOT 4 CLOSED

zouge357 avatar zouge357 commented on July 19, 2024
关于一个细节的问题

from mst.

Comments (4)

caiyuanhao1998 avatar caiyuanhao1998 commented on July 19, 2024

你好,感谢关注。原因是为了在矩阵乘法中节省计算服开销。原先是(HW x C)x(C x HW)。现在改了后是 (C x HW)x(HW x C),这样子就可以把 HW 给消除掉了

from mst.

zouge357 avatar zouge357 commented on July 19, 2024

谢谢您的回复,但是您看代码里面,您将qkv的维度都转换为(1,1,28,147456),此时的话q乘k的转置也同样可以得到(28,28)的通道注意力矩阵呀?这样计算量也是一样的。
image

from mst.

caiyuanhao1998 avatar caiyuanhao1998 commented on July 19, 2024

是的,此时也是消掉 hw,你此时说的q和我说的k是等价的

from mst.

zouge357 avatar zouge357 commented on July 19, 2024

您的意思是无论是q乘k转置还是k乘q转置这个其实无所谓,要求没那么严格,并不是非要按照原本transformer中的公式,只要使用了qkv计算的**就可以吗?

from mst.

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.