def __init__(self, model_file, mother=mother, super_cell_flag=False): ''' loading the regression results ''' self.mother = mother # The flag to inluce 1NN and edges shorter than 1NN NN1 = 1 [ self.Gcv, self.J, self.intercept, self.RMSE_test_atom, self.RMSE_test_site ] = pickle.load(open(model_file, "rb")) self.super_cell_flag = super_cell_flag # Initialize graph object self.Graphs = lf.initialize_graph_object(self.mother, dz, NN1=1) # Initialize calculation object empty = 'grey' filled = 'r' occ = [empty, filled] self.Cal = lf.calculations(occ) self.Gm = self.Graphs.Gm
#%% ''' Read the json files Creat pi matrix size of number of configuration * numbers of clusters ''' empty = 'grey' filled = 'r' occ = [empty, filled] # Initialize the cluster object and isomorphs object Graphs = lf.initialize_graph_object(mother, dz) with open('clusters.json') as f: Gcv = json.load(f)['Gcv'] with open(json_name) as f: ES_data = json.load(f) config_batch_i = ES_data['config_iso'] Graphs.get_configs(config_batch_i) Gsv = Graphs.Gsv Cal = lf.calculations(occ) #pi = Cal.get_pi_matrix_l(Gsv ,Gcv) #np.save(pi_name, pi, allow_pickle = True) pi = np.load('pi_iso_1.npy')