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:

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