Comments (5)
你压缩完成后,再保存为一个新的模型文件,模型文件大小规模你可以看的出来。
压缩肯定会有一点点损失的,不过可以忽略
from mynlp.
@jimichan 感谢回复。
如果单从模型文件大小来看的话,我试了一个,压缩前:862 MB,压缩后:112 MB。
就是压缩花的时间有点长,3分多钟。
from mynlp.
@jimichan 另外还有个问题, quantize(2, false, false) 这里面,参数怎么设置,有文档说明吗,对不同的模型,2是否合适?
from mynlp.
参照官方原版
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.
@jimichan 感谢回复
from mynlp.
Related Issues (20)
- 关于FastText的使用 HOT 7
- fastText加载C原版的压缩模型后,分类出错 HOT 1
- Cannot load pre-trained word vectors HOT 2
- 请问mynlp-classification 训练时文件大小有限制?训练文本较大的时候出现Illegal Capacity: -1异常 HOT 1
- 训练出来的模型能不能整合成一个文件? HOT 3
- 如何添加自己的词典? HOT 1
- 预测标签概率和不等于1? HOT 1
- fasttext支持只有正例样本的训练分类 HOT 4
- java项目依赖mynlp,无法调用,找不到类和方法 HOT 3
- java预测结果与python预测结果不一致 HOT 5
- 新词发现 BUG
- 分词器可能会将一些词前的空格和换行符划分到词中
- java: 非法字符: '\u200b'
- 文档版本未同步
- fasttext修改loss HOT 1
- 压缩cpp模型后,java加载模型预测出错 HOT 6
- 如何关闭分词输出时候的/m, /x, 和/mq标注 HOT 2
- fastText的label有上限 HOT 5
- 训练数据加载
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mynlp.