Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/jon/gp update #71

Merged
merged 4 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions flare/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ def update_db(self, struc: Structure, forces: list,
# create numpy array of training labels
self.training_labels_np = self.force_list_to_np(self.training_labels)

self.set_L_alpha()

def add_one_env(self, env: AtomicEnvironment,
force: np.array, train: bool = False, **kwargs):
"""
Expand Down
4 changes: 3 additions & 1 deletion flare/gp_from_aimd.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def pre_run(self):
train_atoms.append(atom)

self.update_gp_and_print(frame, train_atoms, train=False)
self.gp.set_L_alpha()
stevetorr marked this conversation as resolved.
Show resolved Hide resolved

# These conditions correspond to if either the GP was never trained
# or if data was added to it during the pre-run.
Expand Down Expand Up @@ -207,6 +208,8 @@ def run(self):

if self.train_count < self.max_trains:
self.train_gp()
else:
self.gp.set_L_alpha()

self.output.conclude_run()

Expand Down Expand Up @@ -234,7 +237,6 @@ def update_gp_and_print(self, frame: Structure, train_atoms: List[int],

# update gp model
self.gp.update_db(frame, frame.forces, custom_range=train_atoms)
self.gp.set_L_alpha()

if train:
self.train_gp()
Expand Down
5 changes: 3 additions & 2 deletions flare/otf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, filename, calculate_energy=False):

def make_gp(self, cell=None, kernel=None, kernel_grad=None, algo=None,
call_no=None, cutoffs=None, hyps=None, init_gp=None,
energy_force_kernel=None, hyp_no=None):
energy_force_kernel=None, hyp_no=None, par=True):

if init_gp is None:
# Use run's values as extracted from header
Expand All @@ -71,7 +71,8 @@ def make_gp(self, cell=None, kernel=None, kernel_grad=None, algo=None,
gp_model = \
gp.GaussianProcess(kernel, kernel_grad, gp_hyps,
cutoffs, opt_algorithm=algo,
energy_force_kernel=energy_force_kernel)
energy_force_kernel=energy_force_kernel,
par=par)
else:
gp_model = init_gp
call_no = len(self.gp_position_list)
Expand Down