docs fixes

This commit is contained in:
Soumith Chintala 2017-05-02 15:42:33 -04:00
parent 5aa1f769d3
commit ecd51f8510
5 changed files with 45 additions and 32 deletions

View File

@ -503,6 +503,12 @@ Loss functions
.. autoclass:: MultiMarginLoss
:members:
:hidden:`TripletMarginLoss`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: TripletMarginLoss
:members:
Vision layers
----------------
@ -838,6 +844,11 @@ Loss functions
.. autofunction:: smooth_l1_loss
:hidden:`triplet_margin_loss`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: triplet_margin_loss
Vision functions
----------------

View File

@ -55,33 +55,33 @@ sparse tensors to prevent them from growing too large.
.. class:: FloatTensor()
.. automethod:: add
.. automethod:: add_
.. automethod:: clone
.. automethod:: contiguous
.. automethod:: dim
.. automethod:: div
.. automethod:: div_
.. automethod:: get_device
.. automethod:: hspmm
.. automethod:: indices
.. automethod:: is_contiguous
.. automethod:: mm
.. automethod:: mul
.. automethod:: mul_
.. automethod:: nnz
.. automethod:: resizeAs_
.. automethod:: size
.. automethod:: spadd
.. automethod:: sparse_mask
.. automethod:: spmm
.. automethod:: sspaddmm
.. automethod:: sspmm
.. automethod:: sub
.. automethod:: sub_
.. automethod:: t_
.. automethod:: toDense
.. automethod:: transpose
.. automethod:: transpose_
.. automethod:: values
.. automethod:: zero_
.. method:: add
.. method:: add_
.. method:: clone
.. method:: contiguous
.. method:: dim
.. method:: div
.. method:: div_
.. method:: get_device
.. method:: hspmm
.. method:: indices
.. method:: is_contiguous
.. method:: mm
.. method:: mul
.. method:: mul_
.. method:: nnz
.. method:: resizeAs_
.. method:: size
.. method:: spadd
.. method:: sparse_mask
.. method:: spmm
.. method:: sspaddmm
.. method:: sspmm
.. method:: sub
.. method:: sub_
.. method:: t_
.. method:: toDense
.. method:: transpose
.. method:: transpose_
.. method:: values
.. method:: zero_

View File

@ -691,7 +691,7 @@ def triplet_margin_loss(anchor, positive, negative, margin=1.0, p=2, eps=1e-6, s
.. math::
L(a, p, n) = \frac{1}{N} \left( \sum_{i=1}^N \max \{d(a_i, p_i) - d(a_i, n_i) + {\rm margin}, 0\} \right)
where :math: `d(x_i, y_i) = \| {\bf x}_i - {\bf y}_i \|_2^2`.
where :math:`d(x_i, y_i) = \| {\bf x}_i - {\bf y}_i \|_2^2`.
Args:
anchor: anchor input tensor

View File

@ -105,9 +105,11 @@ class InstanceNorm2d(_InstanceNorm):
eps: a value added to the denominator for numerical stability. Default: 1e-5
momentum: the value used for the running_mean and running_var computation. Default: 0.1
affine: a boolean value that when set to true, gives the layer learnable affine parameters.
Shape:
- Input: :math:`(N, C, H, W)`
- Output: :math:`(N, C, H, W)` (same shape as input)
Examples:
>>> # With Learnable Parameters
>>> m = nn.InstanceNorm2d(100)

View File

@ -448,7 +448,7 @@ class TripletMarginLoss(Module):
.. math::
L(a, p, n) = \frac{1}{N} \left( \sum_{i=1}^N \max \{d(a_i, p_i) - d(a_i, n_i) + {\rm margin}, 0\} \right)
where :math: `d(x_i, y_i) = \| {\bf x}_i - {\bf y}_i \|_2^2`.
where :math:`d(x_i, y_i) = \| {\bf x}_i - {\bf y}_i \|_2^2`.
Args:
anchor: anchor input tensor