This commit is contained in:
Jacob Holder 2023-04-19 15:59:44 +02:00
parent 5e6c84ebf5
commit 4bbc802ee4
Signed by: jacob
GPG Key ID: 2194FC747048A7FD
2 changed files with 25 additions and 11 deletions

View File

@ -43,9 +43,9 @@ class Evaluator(ABC):
@timeit
def generate_mask(self, img: FFT, merge=False):
hash = str(img.intens.shape)
self.mask = self.gen_mask_helper(img, hash=hash)
self.mask = self.gen_mask_helper(img)
if merge:
self.mask = self.merge_mask_helper(hash=hash)
self.mask = self.merge_mask_helper()
self.eval_points = [[a] for a in np.arange(len(self.eval_points))]
@abstractmethod

View File

@ -1,4 +1,5 @@
from lattices import SCC_Lattice, VO2_Lattice
import sys
from spin_image import SpinImage
import numpy as np
import matplotlib.pyplot as plt
@ -121,7 +122,7 @@ def random(seed):
for i in tqdm.tqdm(ind):
maske[np.unravel_index(i, (LEN, LEN))] = True
counter += 1
if np.mod(counter, 100) != 0:
if np.mod(counter, 100) != 0 and not i == ind[-1]:
continue
si.apply_mask(lat.parse_mask(maske))
@ -204,21 +205,34 @@ def ising(seed, temp=0.5):
out_2=out_rect[1], out_3=out_rect[2], out_4=out_rect[3])
def runner():
np.random.seed(1234)
seeds = np.random.randint(0, 10000, 200)
idx = int(sys.argv[1])
if idx < 0:
return
if idx >= seeds.size:
return
seed = seeds[idx]
random(seed)
if __name__ == "__main__":
np.random.seed(1234)
runner()
# test_me()
# test_square()
# test_mixed()
# plt.show()
# random(1234)
# ising(1234)
test_pdf()
plt.show()
exit()
for i in np.random.randint(0, 10000, 5):
random(i)
ising(i, 0.5)
ising(i, 1.0)
ising(i, 1.5)
# test_pdf()
# plt.show()
# exit()
# for i in np.random.randint(0, 10000, 5):
# random(i)
# ising(i, 0.5)
# ising(i, 1.0)
# ising(i, 1.5)
# plt.show()