提交 092828fb 编写于 作者: X xzl

modify the doc of the interface

上级 b6eaed0e
......@@ -30,9 +30,9 @@ namespace paddle {
/**
* The static pruning hook
* Static means user specific a sparsity_ratio map before training started. The
* network will
* hold the sparsity_ratio maximum numbers of parameters, and cut off the rest.
* Static means user specific a sparsity_ratio before training start, and the
* network will prune the parameters based on the sparsity_ratio. More deatils
* can see https://arxiv.org/pdf/1506.02626.pdf.
*/
class StaticPruningHook : public IParameterUpdaterHook {
......
......@@ -25,9 +25,9 @@ enum ParameterInitStrategy {
}
message ParameterUpdaterHookConfig {
// hook type such as 'pruning'
required string type = 1;
//hook type such as 'pruning'
optional double sparsity_ratio = 3;
optional double sparsity_ratio = 2 [default = 0.8];
}
message ParameterConfig {
......
......@@ -59,17 +59,14 @@ def is_compatible_with(x, Type):
class HookAttribute(object):
"""
Hook Attribute object. The hook is an auxiliary operation that occurs
during network propagation. Such as pruning operation, It will cut off
redundant parameters in the network before training. More detail can see
here paddle/parameter/ParameterUpdaterHook.cpp
during network propagation.
NOTE: IT IS A HIGH LEVEL USER INTERFACE.
:param type: Hook type, eg: 'pruning'
:type type: string
:param sparsity_ratio: Must be specified if hook type is 'pruning',
the network will hold the sparsity_ratio maximum parameters, and cut off the rest.
:type sparsity_ratio: float number between 0 and 1
:param sparsity_ratio: Must be specified if hook type is 'pruning'
:type sparsity_ratio: float or None
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册