You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by cm...@apache.org on 2018/11/16 20:48:25 UTC
[incubator-mxnet] branch master updated: Fix Sphinx errors (#13252)
This is an automated email from the ASF dual-hosted git repository.
cmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new be5bac3 Fix Sphinx errors (#13252)
be5bac3 is described below
commit be5bac3a933cf6573c7f9f81a109df8fa5f90d6e
Author: Vandana Kannan <va...@users.noreply.github.com>
AuthorDate: Fri Nov 16 12:48:12 2018 -0800
Fix Sphinx errors (#13252)
---
python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py | 18 ++++++++---------
python/mxnet/io/io.py | 4 ++--
python/mxnet/test_utils.py | 26 +++++++++++++------------
3 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py b/python/mxnet/gluon/contrib/rnn/conv_rnn_cell.py
index 09db547..b7a19f7 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 6cd0c83..2bd1d61 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 d23b563..5f0fbd6 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