mercredi 18 mars 2015

why return np.random.normal(10 - 1. / (x + 0.1), 0.5) works

as we can see:the documentaion from http://ift.tt/1BUeYLG



numpy.random.normal(loc=0.0, scale=1.0, size=None) Draw random samples from a normal (Gaussian) distribution.


The probability density function of the normal distribution, first derived by De Moivre and 200 years later by both Gauss and Laplace independently [R217], is often called the bell curve because of its characteristic shape (see the example below).


The normal distributions occurs often in nature. For example, it describes the commonly occurring distribution of samples influenced by a large number of tiny, random disturbances, each with its own unique distribution [R217]. Parameters:


loc : float


Mean (“centre”) of the distribution.


scale : float


Standard deviation (spread or “width”) of the distribution.


size : int or tuple of ints, optional


Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned.



then why np.random.normal(10 - 1. / (x + 0.1), 0.5) works when x = 10 ** np.linspace(-2, 0, 8) the parameter loc should be float? if this works,what is its meaning?thank you





Aucun commentaire:

Enregistrer un commentaire