-
Notifications
You must be signed in to change notification settings - Fork 876
[Docathon][Add CN Doc No.47-48] #6482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4923e9
add cn doc of ptq
jiangziyan-693 f20937d
[Docathon][Add CN Doc No.48]
jiangziyan-693 11c641d
just to complete CI
jiangziyan-693 4cadcb5
pass the ci
jiangziyan-693 c01847c
cici
jiangziyan-693 85290cf
Merge branch 'develop' of https://github.com/PaddlePaddle/docs into qat
jiangziyan-693 2073bac
fix style
sunzhongkai588 db118ef
Rename ptq_cn.rst to PTQ_cn.rst
jiangziyan-693 6f82d68
Rename qat_cn.rst to QAT_cn.rst
jiangziyan-693 0ab7b7c
Update QAT_cn.rst
jiangziyan-693 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| .. _cn_api_paddle_quantization_PTQ: | ||
|
|
||
| PTQ | ||
| ------------------------------- | ||
| .. py:class:: paddle.quantization.PTQ(Quantization) | ||
| 将训练后量化应用到模型上。 | ||
|
|
||
| 方法 | ||
| :::::::::::: | ||
| quantize(model: Layer, inplace=False) | ||
| ''''''''' | ||
|
|
||
| 创建一个用于训练后量化的模型。 | ||
|
|
||
| 量化配置将在模型中传播。它将向模型中插入观察者以收集和计算量化参数。 | ||
|
|
||
| **参数** | ||
|
|
||
| - **model**(Layer) - 待量化的模型。 | ||
| - **inplace**(bool) - 是否对模型进行原地修改 | ||
| **返回** | ||
|
|
||
| 为训练后量化准备好的模型。 | ||
|
|
||
| **代码示例** | ||
|
|
||
| COPY-FROM: paddle.quantization.PTQ.quantize | ||
|
|
||
| convert(self, model:layer, inplace=False, remain_weight=False): | ||
| ''''''''' | ||
|
|
||
| 将量化模型转换为 ONNX 格式。转换后的模型可以通过调用 paddle.jit.save 保存为推理模型。 | ||
|
|
||
| **参数** | ||
|
|
||
| - **model**(Layer) - 待量化的模型。 | ||
| - **inplace**(bool, optional) - 是否要对模型进行就地修改,默认为 false。 | ||
| - **remain_weight**(bool, optional) - 是否宝石权重为 floats,默认为 false。 | ||
| **返回** | ||
|
|
||
| 转换后的模型 | ||
|
|
||
| **代码示例** | ||
|
|
||
| COPY-FROM: paddle.quantization.PTQ.convert | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| .. _cn_api_paddle_quantization_QAT: | ||
|
|
||
| QAT | ||
| ------------------------------- | ||
|
|
||
| .. py:class:: paddle.quantization.QAT(config: paddle.quantization.config.QuantConfig) | ||
| 用于为量化感知训练准备模型的工具。 | ||
|
|
||
| 参数 | ||
| :::::::::::: | ||
| - **config** (QuantConfig) - 量化配置,通常指的是设置和调整模型量化过程中的参数和选项。 | ||
|
|
||
| **代码示例** | ||
|
|
||
| COPY-FROM: paddle.quantization.QAT.quantize | ||
|
|
||
| 方法 | ||
| :::::::::::: | ||
| quantize(model: Layer, inplace=False) | ||
| ''''''''' | ||
| 创建一个适用于量化感知训练的模型。 | ||
|
|
||
| 量化配置将在模型中传播。并且它将在模型中插入伪量化器以模拟量化过程。 | ||
|
|
||
| **参数** | ||
|
|
||
| - **model(Layer)** - 待量化的模型 | ||
| - **inplace(bool)** - 是否对模型进行原地修改 | ||
|
|
||
| **返回** | ||
|
|
||
| 为量化感知训练准备好的模型。 | ||
|
|
||
| **代码示例** | ||
|
|
||
| COPY-FROM: paddle.quantization.QAT.quantize | ||
|
|
||
| convert(self, model:layer, inplace=False, remain_weight=False): | ||
| ''''''''' | ||
|
|
||
| 将量化模型转换为 ONNX 格式。转换后的模型可以通过调用 paddle.jit.save 保存为推理模型。 | ||
|
|
||
| **参数** | ||
|
|
||
| - **model**(Layer) - 待量化的模型。 | ||
| - **inplace**(bool, optional) - 是否要对模型进行就地修改,默认为 false。 | ||
| - **remain_weight**(bool, optional) - 是否宝石权重为 floats,默认为 false。 | ||
| **返回** | ||
|
|
||
| 转换后的模型 | ||
|
|
||
| **代码示例** | ||
|
|
||
| COPY-FROM: paddle.quantization.QAT.convert |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
宝石?
是保持?