diff --git a/flare/gp_from_aimd.py b/flare/gp_from_aimd.py index 747e10faf..6f2d6ff4e 100644 --- a/flare/gp_from_aimd.py +++ b/flare/gp_from_aimd.py @@ -29,8 +29,7 @@ def __init__(self, frames: List[Structure], calculate_energy: bool = False, output_name: str = 'gp_from_aimd', max_atoms_from_frame: int = np.inf, max_trains: int = np.inf, - min_atoms_added: int = 1, - n_cpus: int = 1, shuffle_frames: bool = False, + min_atoms_added: int = 1, shuffle_frames: bool = False, verbose: int = 0, model_write: str = '', pre_train_on_skips: bool = False, pre_train_seed_frames: List[Structure] = None, @@ -94,8 +93,6 @@ def __init__(self, frames: List[Structure], self.output = Output(output_name) - # set number of cpus for parallelization - self.n_cpus = n_cpus # To later be filled in using the time library self.start_time = None @@ -130,7 +127,8 @@ def pre_run(self): self.abs_std_tolerance)) self.start_time = time.time() - + if self.verbose >= 3: + print("Now beginning pre-run training.") # If seed environments were passed in, add them to the GP. for point in self.seed_envs: self.gp.add_one_env(point[0], point[1], train=False) @@ -139,7 +137,7 @@ def pre_run(self): # Take one of each atom species in the first frame # so all atomic species are represented in the first step. # Otherwise use the seed frames passed in by user. - if len(self.gp.training_data) == 0 and self.seed_frames is None: + if len(self.gp.training_data) == 0 and self.seed_frames is []: self.seed_frames = [self.frames[0]] for frame in self.seed_frames: @@ -161,10 +159,13 @@ def pre_run(self): # These conditions correspond to if either the GP was never trained # or if data was added to it during the pre-run. + if self.verbose >= 3: + print("Now commencing initial training of GP (which has " + "non-empty training set)") if (self.gp.l_mat is None) \ - or (self.seed_frames is not None - or self.seed_envs is not None): + or (self.seed_frames is not [] + or self.seed_envs is not []): self.gp.train(output=self.output if self.verbose > 0 else None) def run(self): @@ -174,7 +175,8 @@ def run(self): the training set upon the triggering of the uncertainty threshold. :return: """ - + if self.verbose >= 3: + print("Commencing run with pre-run...") self.pre_run() # Loop through trajectory