Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Module « numpy.matlib »

Fonction randn - module numpy.matlib

Signature de la fonction randn

def randn(*args) 

Description

help(numpy.matlib.randn)

Return a random matrix with data from the "standard normal" distribution.

`randn` generates a matrix filled with random floats sampled from a
univariate "normal" (Gaussian) distribution of mean 0 and variance 1.

Parameters
----------
\*args : Arguments
    Shape of the output.
    If given as N integers, each integer specifies the size of one
    dimension. If given as a tuple, this tuple gives the complete shape.

Returns
-------
Z : matrix of floats
    A matrix of floating-point samples drawn from the standard normal
    distribution.

See Also
--------
rand, numpy.random.RandomState.randn

Notes
-----
For random samples from the normal distribution with mean ``mu`` and
standard deviation ``sigma``, use::

    sigma * np.matlib.randn(...) + mu

Examples
--------
>>> np.random.seed(123)
>>> import numpy.matlib
>>> np.matlib.randn(1)
matrix([[-1.0856306]])
>>> np.matlib.randn(1, 2, 3)
matrix([[ 0.99734545,  0.2829785 , -1.50629471],
        [-0.57860025,  1.65143654, -2.42667924]])

Two-by-four matrix of samples from the normal distribution with
mean 3 and standard deviation 2.5:

>>> 2.5 * np.matlib.randn((2, 4)) + 3
matrix([[1.92771843, 6.16484065, 0.83314899, 1.30278462],
        [2.76322758, 6.72847407, 1.40274501, 1.8900451 ]])



Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé