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
this disclaimer
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
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

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