Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from .worley import WorleyNoiseTensor 

2from .fractal import FractalNoiseTensor 

3 

4 

5class NoiseTensorGenerator(): 

6 def __init__(self, shape): 

7 self.fractal = FractalNoiseTensor(shape) 

8 self.worley = WorleyNoiseTensor(shape) 

9 self.shape = shape 

10 

11 def __call__(self, *args, **kwargs): 

12 return self.fractal(*args, **kwargs) if np.random.rand() < 0.5 else self.worley(*args, **kwargs) 

13 

14 

15class NoiseSR(WorleySR): 

16 def build_generator(self, shape): 

17 return NoiseTensorGenerator(shape=shape) 

18 

19 

20if __name__ == "__main__": 

21 NoiseSR.main()