From bec6a5ffcd2a9bb6a2d28541172dcce63f45d58c Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Mon, 26 Jun 2023 16:31:27 +0200 Subject: [PATCH] Fix: Non-int harmonics were faulty --- priorConditionedAnnealing/noise.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/priorConditionedAnnealing/noise.py b/priorConditionedAnnealing/noise.py index a87cfd7..2d5d8ea 100644 --- a/priorConditionedAnnealing/noise.py +++ b/priorConditionedAnnealing/noise.py @@ -116,11 +116,11 @@ class Harmonic_Perlin_Noise(): self.scale = scale if type(octaves) in [int, float]: int_octaves = int(octaves) - octaves = [1/(i+1) for i in range(int_octaves)] + octaves_arr = [1/(i+1) for i in range(int_octaves)] if type(octaves) == float: - octaves += [1/(int_octaves+2)*(octaves-int_octaves)] - octaves = np.array(octaves) - self.octaves = octaves / np.linalg.norm(octaves) + octaves_arr += [1/(int_octaves+2)*(octaves-int_octaves)] + octaves_arr = np.array(octaves_arr) + self.octaves = octaves_arr / np.linalg.norm(octaves_arr) self.reset() def __call__(self, shape):