ChaiBapchya commented on a change in pull request #15772: Add symbol api for
randn and fix shape issue for randn ndarray and symbol api
URL: https://github.com/apache/incubator-mxnet/pull/15772#discussion_r311693614
##########
File path: python/mxnet/symbol/random.py
##########
@@ -113,6 +113,31 @@ def normal(loc=0, scale=1, shape=_Null, dtype=_Null,
**kwargs):
[loc, scale], shape, dtype, kwargs)
+def randn(*shape, **kwargs):
+ """Draw random samples from a normal (Gaussian) distribution.
+
+ Samples are distributed according to a normal distribution parametrized
+ by *loc* (mean) and *scale* (standard deviation).
+
+
+ Parameters
+ ----------
+ loc : float or NDArray
+ Mean (centre) of the distribution.
+ scale : float or NDArray
+ Standard deviation (spread or width) of the distribution.
+ shape : int or tuple of ints
+ The number of samples to draw. If shape is, e.g., `(m, n)` and `loc`
and
+ `scale` are scalars, output shape will be `(m, n)`. If `loc` and
`scale`
+ are NDArrays with shape, e.g., `(x, y)`, then output will have shape
+ `(x, y, m, n)`, where `m*n` samples are drawn for each `[loc, scale)`
pair.
+ dtype : {'float16', 'float32', 'float64'}
+ Data type of output samples. Default is 'float32'
+ """
+ return _random_helper(_internal._random_normal, _internal._sample_normal,
+ [loc, scale], shape, dtype, ctx, out, kwargs)
Review comment:
addressed!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services