From 55cbd734c0929257a961c152597a424be72a727f Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 22 May 2023 17:39:57 +0200 Subject: [PATCH] Fix: Perlin had a 'bad' magic number (correlated outputs) --- priorConditionedAnnealing/noise.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/priorConditionedAnnealing/noise.py b/priorConditionedAnnealing/noise.py index 224dbd2..230711d 100644 --- a/priorConditionedAnnealing/noise.py +++ b/priorConditionedAnnealing/noise.py @@ -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)