3 examples of 'np random normal' in Python

Every line of 'np random normal' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
137def rand_normal(self, shape, mean=0.0, stddev=1.0):
138 import pdfinsight.ai.yolo_tf.src.tools.pyolo as pyolo
139 n_dims = 1
140 for dim in shape:
141 n_dims *= dim
142 array = numpy.zeros((n_dims, ), dtype='float32')
143
144 for i in range(n_dims):
145 array[i] = pyolo.rand_normal()
146
147 array = numpy.reshape(array, shape)
148
149 return array
124def random_normal(self, shape, mean=0.0, stddev=1.0, dtype=None, seed=None):
125 np.random.seed(seed)
126 dtype = dtype or self.floatx()
127 return np.random.normal(size=shape, loc=mean, scale=stddev).astype(dtype)
18def normal_init(shape, sigma):
19 W = np.random.normal(0.0, sigma, shape)
20 return W.astype(dtype)

Related snippets