You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/11/16 20:48:13 UTC

[GitHub] gigasquid closed pull request #13252: Fix Sphinx errors

gigasquid closed pull request #13252: Fix Sphinx errors
URL: https://github.com/apache/incubator-mxnet/pull/13252
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py b/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py
index 09db5470ef9..b7a19f78b2f 100644
--- a/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py
+++ b/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py
@@ -255,7 +255,7 @@ class Conv1DRNNCell(_ConvRNNCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_rnn_'
+    prefix : str, default ``'conv_rnn_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -322,7 +322,7 @@ class Conv2DRNNCell(_ConvRNNCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_rnn_'
+    prefix : str, default ``'conv_rnn_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -389,7 +389,7 @@ class Conv3DRNNCell(_ConvRNNCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_rnn_'
+    prefix : str, default ``'conv_rnn_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -519,7 +519,7 @@ class Conv1DLSTMCell(_ConvLSTMCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_lstm_'
+    prefix : str, default ``'conv_lstm_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -596,7 +596,7 @@ class Conv2DLSTMCell(_ConvLSTMCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_lstm_'
+    prefix : str, default ``'conv_lstm_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -673,7 +673,7 @@ class Conv3DLSTMCell(_ConvLSTMCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_lstm_'
+    prefix : str, default ``'conv_lstm_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -803,7 +803,7 @@ class Conv1DGRUCell(_ConvGRUCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_gru_'
+    prefix : str, default ``'conv_gru_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -875,7 +875,7 @@ class Conv2DGRUCell(_ConvGRUCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_gru_'
+    prefix : str, default ``'conv_gru_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
@@ -947,7 +947,7 @@ class Conv3DGRUCell(_ConvGRUCell):
         If argument type is string, it's equivalent to nn.Activation(act_type=str). See
         :func:`~mxnet.ndarray.Activation` for available choices.
         Alternatively, other activation blocks such as nn.LeakyReLU can be used.
-    prefix : str, default 'conv_gru_'
+    prefix : str, default ``'conv_gru_``'
         Prefix for name of layers (and name of weight if params is None).
     params : RNNParams, default None
         Container for weight sharing between cells. Created if None.
diff --git a/python/mxnet/io/io.py b/python/mxnet/io/io.py
index 6cd0c83e116..2bd1d6115ac 100644
--- a/python/mxnet/io/io.py
+++ b/python/mxnet/io/io.py
@@ -490,8 +490,8 @@ class NDArrayIter(DataIter):
     """Returns an iterator for ``mx.nd.NDArray``, ``numpy.ndarray``, ``h5py.Dataset``
     ``mx.nd.sparse.CSRNDArray`` or ``scipy.sparse.csr_matrix``.
 
-    Example usage:
-    ----------
+    Examples
+    --------
     >>> data = np.arange(40).reshape((10,2,2))
     >>> labels = np.ones([10, 1])
     >>> dataiter = mx.io.NDArrayIter(data, labels, 3, True, last_batch_handle='discard')
diff --git a/python/mxnet/test_utils.py b/python/mxnet/test_utils.py
index d23b563add9..5f0fbd65981 100644
--- a/python/mxnet/test_utils.py
+++ b/python/mxnet/test_utils.py
@@ -1844,21 +1844,23 @@ def var_check(generator, sigma, nsamples=1000000):
 
 def chi_square_check(generator, buckets, probs, nsamples=1000000):
     """Run the chi-square test for the generator. The generator can be both continuous and discrete.
-    If the generator is continuous, the buckets should contain tuples of (range_min, range_max) and
-     the probs should be the corresponding ideal probability within the specific ranges.
-    Otherwise, the buckets should be the possible output of the discrete distribution and the probs
-     should be groud-truth probability.
+
+    If the generator is continuous, the buckets should contain tuples of (range_min, range_max) \
+    and the probs should be the corresponding ideal probability within the specific ranges. \
+    Otherwise, the buckets should be the possible output of the discrete distribution and the \
+    probs should be groud-truth probability.
 
     Usually the user is required to specify the probs parameter.
 
-    After obtatining the p value, we could further use the standard p > 0.05 threshold to get
-     the final result.
+    After obtatining the p value, we could further use the standard p > 0.05 threshold to get \
+    the final result.
 
     Examples::
-        buckets, probs = gen_buckets_probs_with_ppf(lambda x: ss.norm.ppf(x, 0, 1), 5)
-        generator = lambda x: np.random.normal(0, 1.0, size=x)
-        p = chi_square_check(generator=generator, buckets=buckets, probs=probs)
-        assert(p > 0.05)
+
+      buckets, probs = gen_buckets_probs_with_ppf(lambda x: ss.norm.ppf(x, 0, 1), 5)
+      generator = lambda x: np.random.normal(0, 1.0, size=x)
+      p = chi_square_check(generator=generator, buckets=buckets, probs=probs)
+      assert(p > 0.05)
 
     Parameters
     ----------
@@ -1867,8 +1869,8 @@ def chi_square_check(generator, buckets, probs, nsamples=1000000):
         generator(N) should generate N random samples.
     buckets: list of tuple or list of number
         The buckets to run the chi-square the test. Make sure that the buckets cover
-         the whole range of the distribution. Also, the buckets must be in ascending order and have
-         no intersection
+        the whole range of the distribution. Also, the buckets must be in ascending order and have
+        no intersection
     probs: list or tuple
         The ground-truth probability of the random value fall in a specific bucket.
     nsamples:int


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services