提交 63e4e16c 编写于 作者: D dangqingqing

add smooth_l1 interface to v2 doc.

上级 28384912
...@@ -498,10 +498,10 @@ hsigmoid ...@@ -498,10 +498,10 @@ hsigmoid
:members: hsigmoid :members: hsigmoid
:noindex: :noindex:
smooth_l1 smooth_l1_cost
--------- --------------
.. automodule:: paddle.trainer_config_helpers.layers .. automodule:: paddle.trainer_config_helpers.layers
:members: smooth_l1 :members: smooth_l1_cost
:noindex: :noindex:
Check Layer Check Layer
......
...@@ -421,7 +421,7 @@ hsigmoid ...@@ -421,7 +421,7 @@ hsigmoid
smooth_l1 smooth_l1
--------- ---------
.. automodule:: paddle.v2.layer.smooth_l1 .. autoclass:: paddle.v2.layer.smooth_l1_cost
:noindex: :noindex:
Check Layer Check Layer
......
...@@ -116,7 +116,7 @@ __all__ = [ ...@@ -116,7 +116,7 @@ __all__ = [
'spp_layer', 'spp_layer',
'pad_layer', 'pad_layer',
'eos_layer', 'eos_layer',
'smooth_l1', 'smooth_l1_cost',
'layer_support', 'layer_support',
] ]
...@@ -5283,7 +5283,7 @@ def multi_binary_label_cross_entropy(input, ...@@ -5283,7 +5283,7 @@ def multi_binary_label_cross_entropy(input,
@wrap_name_default() @wrap_name_default()
@layer_support() @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 This is a L1 loss but more smooth. It requires that the
size of input and label are equal. The formula is as follows, 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): ...@@ -5296,19 +5296,15 @@ def smooth_l1(input, label, name=None, layer_attr=None):
.. math:: .. math::
mooth_{L1}(x) = smooth_{L1}(x) = \\begin{cases} 0.5x^2& \\text{if} \\ |x| < 1 \\\\ |x|-0.5& \\text{otherwise} \end{cases}
\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 More details can be found by referring to `Fast R-CNN
<https://arxiv.org/pdf/1504.08083v2.pdf>`_ <https://arxiv.org/pdf/1504.08083v2.pdf>`_
.. code-block:: python .. code-block:: python
cost = smooth_l1(input=input_layer, cost = smooth_l1_cost(input=input_layer,
label=label_layer) label=label_layer)
:param input: The input layer. :param input: The input layer.
:type input: LayerOutput :type input: LayerOutput
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册