nip.utils.maths.minstd_generate_pseudo_random_sequence#
- nip.utils.maths.minstd_generate_pseudo_random_sequence(seed: Int[Tensor, '...'], length: int) Int[Tensor, '... length'] [source]#
Generate a pseudo-random sequence of numbers using the MINSTD algorithm.
The MINSTD algorithm is a simple linear congruential generator (LCG) that is defined by the following recurrence relation:
where
is the seed value.- Parameters:
seed (Int[Tensor, ...]) – The seed value for the pseudo-random number generator. This is a tensor of arbitrary shape.
length (int) – The length of the pseudo-random sequence to generate.
- Returns:
pseudo_random_sequence (Int[Tensor, “… length”]) – The pseudo-random sequence of numbers
generated using the MINSTD algorithm. An extra dimension is added to the output tensor to represent the sequence length.