Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
092828fb
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
092828fb
编写于
6月 05, 2017
作者:
X
xzl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the doc of the interface
上级
b6eaed0e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
12 deletion
+9
-12
paddle/parameter/ParameterUpdaterHook.cpp
paddle/parameter/ParameterUpdaterHook.cpp
+3
-3
proto/ParameterConfig.proto
proto/ParameterConfig.proto
+2
-2
python/paddle/trainer_config_helpers/attrs.py
python/paddle/trainer_config_helpers/attrs.py
+4
-7
未找到文件。
paddle/parameter/ParameterUpdaterHook.cpp
浏览文件 @
092828fb
...
@@ -30,9 +30,9 @@ namespace paddle {
...
@@ -30,9 +30,9 @@ namespace paddle {
/**
/**
* The static pruning hook
* The static pruning hook
* Static means user specific a sparsity_ratio
map before training started. T
he
* Static means user specific a sparsity_ratio
before training start, and t
he
* network will
* network will
prune the parameters based on the sparsity_ratio. More deatils
*
hold the sparsity_ratio maximum numbers of parameters, and cut off the rest
.
*
can see https://arxiv.org/pdf/1506.02626.pdf
.
*/
*/
class
StaticPruningHook
:
public
IParameterUpdaterHook
{
class
StaticPruningHook
:
public
IParameterUpdaterHook
{
...
...
proto/ParameterConfig.proto
浏览文件 @
092828fb
...
@@ -25,9 +25,9 @@ enum ParameterInitStrategy {
...
@@ -25,9 +25,9 @@ enum ParameterInitStrategy {
}
}
message
ParameterUpdaterHookConfig
{
message
ParameterUpdaterHookConfig
{
// hook type such as 'pruning'
required
string
type
=
1
;
required
string
type
=
1
;
//hook type such as 'pruning'
optional
double
sparsity_ratio
=
2
[
default
=
0.8
];
optional
double
sparsity_ratio
=
3
;
}
}
message
ParameterConfig
{
message
ParameterConfig
{
...
...
python/paddle/trainer_config_helpers/attrs.py
浏览文件 @
092828fb
...
@@ -59,17 +59,14 @@ def is_compatible_with(x, Type):
...
@@ -59,17 +59,14 @@ def is_compatible_with(x, Type):
class
HookAttribute
(
object
):
class
HookAttribute
(
object
):
"""
"""
Hook Attribute object. The hook is an auxiliary operation that occurs
Hook Attribute object. The hook is an auxiliary operation that occurs
during network propagation. Such as pruning operation, It will cut off
during network propagation.
redundant parameters in the network before training. More detail can see
here paddle/parameter/ParameterUpdaterHook.cpp
NOTE: IT IS A HIGH LEVEL USER INTERFACE.
NOTE: IT IS A HIGH LEVEL USER INTERFACE.
:param type: Hook type, eg: 'pruning'
:param type: Hook type, eg: 'pruning'
:type type: string
:type type: string
:param sparsity_ratio: Must be specified if hook type is 'pruning',
: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 or None
:type sparsity_ratio: float number between 0 and 1
"""
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录