Skip to main content
added 241 characters in body
Source Link
Charlie Parker
  • 7.1k
  • 14
  • 77
  • 130

Here is the pseudocode:

  1. $v \sim MultiVariateGaussian(\mu,\sigma I)$
  2. $v = \frac{v}{ \| v \| }$

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)

I don't understand this well enough but I've been told by whuber that:

v = torch.normal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)

is also correct i.e. sampling from a univariate normal for each coordinate.

Here is the pseudocode:

  1. $v \sim MultiVariateGaussian(\mu,\sigma I)$
  2. $v = \frac{v}{ \| v \| }$

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(10000)

Here is the pseudocode:

  1. $v \sim MultiVariateGaussian(\mu,\sigma I)$
  2. $v = \frac{v}{ \| v \| }$

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)

I don't understand this well enough but I've been told by whuber that:

v = torch.normal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)

is also correct i.e. sampling from a univariate normal for each coordinate.

added 113 characters in body
Source Link
Charlie Parker
  • 7.1k
  • 14
  • 77
  • 130

Here is the pseudocode:

  1. $v \sim MultiVariateGaussian(\mu,\sigma I)$
  2. $v = \frac{v}{ \| v \| }$

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(10000)

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(10000)

Here is the pseudocode:

  1. $v \sim MultiVariateGaussian(\mu,\sigma I)$
  2. $v = \frac{v}{ \| v \| }$

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(10000)
Source Link
Charlie Parker
  • 7.1k
  • 14
  • 77
  • 130

In pytorch:

v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(10000)