diff --git a/doc/api/v1/trainer_config_helpers/layers.rst b/doc/api/v1/trainer_config_helpers/layers.rst index 9dec89063ae94038d7d847db9061e7e61ba9de9b..75c1b35246486528524fd5baa04704249d5a9275 100644 --- a/doc/api/v1/trainer_config_helpers/layers.rst +++ b/doc/api/v1/trainer_config_helpers/layers.rst @@ -498,10 +498,10 @@ hsigmoid :members: hsigmoid :noindex: -smooth_l1 ---------- +smooth_l1_cost +-------------- .. automodule:: paddle.trainer_config_helpers.layers - :members: smooth_l1 + :members: smooth_l1_cost :noindex: Check Layer diff --git a/doc/api/v2/config/layer.rst b/doc/api/v2/config/layer.rst index 4e3589ebc47039a4bc4e04b130c0aa536dda73a1..0ade7990193d710792bbff78f6b7d338549471f6 100644 --- a/doc/api/v2/config/layer.rst +++ b/doc/api/v2/config/layer.rst @@ -421,7 +421,7 @@ hsigmoid smooth_l1 --------- -.. automodule:: paddle.v2.layer.smooth_l1 +.. autoclass:: paddle.v2.layer.smooth_l1_cost :noindex: Check Layer diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index 1796e48f09ae50642897af7e783f020580772ac4..b9e3d264042275070dd96bc6c192f9376378b8fe 100755 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -116,7 +116,7 @@ __all__ = [ 'spp_layer', 'pad_layer', 'eos_layer', - 'smooth_l1', + 'smooth_l1_cost', 'layer_support', ] @@ -5283,7 +5283,7 @@ def multi_binary_label_cross_entropy(input, @wrap_name_default() @layer_support() -def smooth_l1(input, label, name=None, layer_attr=None): +def smooth_l1_cost(input, label, name=None, layer_attr=None): """ This is a L1 loss but more smooth. It requires that the size of input and label are equal. The formula is as follows, @@ -5296,19 +5296,15 @@ def smooth_l1(input, label, name=None, layer_attr=None): .. math:: - mooth_{L1}(x) = - \begin{cases} - 0.5x^2& \text{if} |x| < 1 \\ - |x|-0.5& \text{otherwise} - \end{cases} + smooth_{L1}(x) = \\begin{cases} 0.5x^2& \\text{if} \\ |x| < 1 \\\\ |x|-0.5& \\text{otherwise} \end{cases} More details can be found by referring to `Fast R-CNN `_ .. code-block:: python - cost = smooth_l1(input=input_layer, - label=label_layer) + cost = smooth_l1_cost(input=input_layer, + label=label_layer) :param input: The input layer. :type input: LayerOutput