I am trying to port code for a generative model from python/pytorch to javascript.
To do this, I need to generate a vector of size (256,) of values sampled from a normal distribution with a seed for determinism.
In python/pytorch, I can do the following:
import torch
seed = 42
torch.manual_seed(seed)
vector = torch.randn((256))
This code ensures I get the same vector of 256 elements sampled from a normal distribution.
How can I do this in javascript?
I've seen several code examples for sampling a single value from a random normal distribution with seed. I cannot find anything for sampling a vector of random normal values with seed.
Does anyone know of a good way to do this?