paraphernalia.torch.noise module¶
Noise generating functions.
- perlin(width, height, frequency=1.0, fade=<function <lambda>>, device=None)[source]¶
Generate 2d Perlin noise.
Adapted from:
https://gist.github.com/adefossez/0646dbe9ed4005480a2407c62aac8869
https://gist.github.com/vadimkantorov/ac1b097753f217c5c11bc2ff396e0a57
https://weber.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
- Parameters
width (int) – target width
height (int) – target height
frequency (float, optional) – Defaults to 1.0.
fade – a fade function
device ([type], optional) – [description]. Defaults to None.
- Returns
a (h, w) tensor
- Return type
Tensor
- fractal(width, height, frequency=1.0, frequency_factor=2.0, amplitude_factor=0.8, octaves=4, device=None)[source]¶
Fractal Perlin noise generator.
- Parameters
width (int) – target width
height (int) – target height
frequency (float, optional) – [description]. Defaults to 1.0.
frequency_factor (float, optional) – [description]. Defaults to 2.0.
amplitude_factor (float, optional) – [description]. Defaults to 0.8.
octaves (int, optional) – Number of different scale to use. Defaults to 4.
device ([type], optional) – Defaults to None.
- Returns
[description]
- Return type
Tensor