diff --git a/priorConditionedAnnealing/noise.py b/priorConditionedAnnealing/noise.py index 0bdb8a6..efec67c 100644 --- a/priorConditionedAnnealing/noise.py +++ b/priorConditionedAnnealing/noise.py @@ -116,16 +116,17 @@ class Perlin_Noise(): shape = self.known_shape self.index += 1 noise = [self.noise([self.index*self.scale, self.magic+(2*a)]) / self.normal_factor - for a in range(shape[-1])] + for a in range(np.prod(shape))] if self.index % self.clear_cache_every == 0: self.noise.cache = {} - return th.Tensor(noise) + return th.Tensor(noise).view(shape) def reset(self): self.index = 0 self.noise = PerlinNoise(octaves=self.octave) -class Async_Perlin_Noise(): + +class Sync_Perlin_Noise(): def __init__(self, known_shape=None, scale=0.1, octave=1): self.known_shape = known_shape self.scale = scale @@ -141,10 +142,10 @@ class Async_Perlin_Noise(): shape = self.known_shape self.index += 1 noise = [self.noise([self.index*self.scale, self.magic+(2*a)]) / self.normal_factor - for a in range(np.prod(shape))] + for a in range(shape[-1])] if self.index % self.clear_cache_every == 0: self.noise.cache = {} - return th.Tensor(noise).view(shape) + return th.Tensor(noise) def reset(self): self.index = 0 diff --git a/priorConditionedAnnealing/pca.py b/priorConditionedAnnealing/pca.py index 643e160..1f9db06 100644 --- a/priorConditionedAnnealing/pca.py +++ b/priorConditionedAnnealing/pca.py @@ -55,13 +55,13 @@ class Avaible_Noise_Funcs(Enum): DIRTYPERLIN = 5 SDE = 6 SHORTPINK = 7 - ASYNCPERLIN = 8 + SYNCPERLIN = 8 RAYLEIGHPERLIN = 9 def get_func(self): # stil aaaaaaaa - return [noise.White_Noise, noise.Pink_Noise, noise.Colored_Noise, noise.Perlin_Noise, noise.Harmonic_Perlin_Noise, noise.Dirty_Perlin_Noise, noise.SDE_Noise, noise.shortPink_Noise, noise.Async_Perlin_Noise, noise.Rayleigh_Perlin_Noise][self.value] + return [noise.White_Noise, noise.Pink_Noise, noise.Colored_Noise, noise.Perlin_Noise, noise.Harmonic_Perlin_Noise, noise.Dirty_Perlin_Noise, noise.SDE_Noise, noise.shortPink_Noise, noise.Sync_Perlin_Noise, noise.Rayleigh_Perlin_Noise][self.value] def cast_to_enum(inp, Class):