Skip to content

Instantly share code, notes, and snippets.

@MLWhiz
Created June 15, 2019 04:06
Show Gist options
  • Save MLWhiz/c59137f4a9836a71a38b50bda604bdd2 to your computer and use it in GitHub Desktop.
Save MLWhiz/c59137f4a9836a71a38b50bda604bdd2 to your computer and use it in GitHub Desktop.
def gen_noise(batch_size, noise_shape):
''' Generates a numpy vector sampled from normal distribution of shape (batch_size,noise_shape)
Input:
batch_size : size of batch
noise_shape: shape of noise vector, normally kept as 100
Output:a numpy vector sampled from normal distribution of shape (batch_size,noise_shape)
'''
return np.random.normal(0, 1, size=(batch_size,)+noise_shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment