modify the doc of the interface

gangliao-patch-1
xzl 8 years ago
parent b6eaed0eab
commit 092828fbe3

@ -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. The * Static means user specific a sparsity_ratio before training start, and the
* 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 {

@ -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 {

@ -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
""" """

Loading…
Cancel
Save