Git Product home page Git Product logo

Comments (5)

jimichan avatar jimichan commented on May 27, 2024

你压缩完成后,再保存为一个新的模型文件,模型文件大小规模你可以看的出来。
压缩肯定会有一点点损失的,不过可以忽略

from mynlp.

codelast avatar codelast commented on May 27, 2024

@jimichan 感谢回复。
如果单从模型文件大小来看的话,我试了一个,压缩前:862 MB,压缩后:112 MB。
就是压缩花的时间有点长,3分多钟。

from mynlp.

codelast avatar codelast commented on May 27, 2024

@jimichan 另外还有个问题, quantize(2, false, false) 这里面,参数怎么设置,有文档说明吗,对不同的模型,2是否合适?

from mynlp.

jimichan avatar jimichan commented on May 27, 2024

参照官方原版
dsub: Int = 2,
qnorm: Boolean = false,
qout: Boolean = false

-qnorm quantizing the norm separately [0]
-qout quantizing the classifier [0]
-dsub size of each sub-vector [2]

影响最大是dsub,表示子空间的维度,越大压缩模型越小,误差越大
,如果你模型的维度是100,那么dsub一定要被100整除才行。

你可以测试一下你的模型在dsub增加到多少是,p和r开始严重下降。

另外压缩后,你把模型另存。生成环境直接使用压缩模型即可,所以压缩时间长度无所谓。
另外压缩操作需要消耗大的内存

from mynlp.

codelast avatar codelast commented on May 27, 2024

@jimichan 感谢回复

from mynlp.

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.