Fix: Perlin had a 'bad' magic number (correlated outputs)

This commit is contained in:
Dominik Moritz Roth 2023-05-22 17:39:57 +02:00
parent bf22f42cb3
commit 55cbd734c0

View File

@ -93,14 +93,14 @@ class Perlin_Noise():
self.known_shape = known_shape
self.scale = scale
self.octaves = octaves
self.magic = 0.141592653589 # Axis offset, should be (kinda) irrational
self.magic = 3.141592653589 # Axis offset, should be (kinda) irrational
# We want to genrate samples, that approx ~N(0,1)
self.normal_factor = 0.0471
self.reset()
def __call__(self, shape):
self.index += 1
noise = [self.noise([self.index*self.scale, self.magic*(a+1)]) / self.normal_factor
noise = [self.noise([self.index*self.scale, self.magic*a]) / self.normal_factor
for a in range(self.known_shape[-1])]
return th.Tensor(noise)