Commit b9ff7151 authored by Malthe Kjær Bisbo's avatar Malthe Kjær Bisbo
Browse files

modified logfile

parent c1e7ed44
......@@ -335,11 +335,13 @@ class GOFEE():
relaxed_candidates = self.certainty_filter(relaxed_candidates)
relaxed_candidates = self.population.pop_MLrelaxed + relaxed_candidates
"""
if self.master:
Epred = np.array([a.info['key_value_pairs']['Epred'] for a in relaxed_candidates])
Epred_std = np.array([a.info['key_value_pairs']['Epred_std'] for a in relaxed_candidates])
fitness = Epred - self.kappa*Epred_std
print(np.c_[Epred, Epred_std, fitness])
"""
return relaxed_candidates
def generate_candidate(self):
......
......@@ -240,9 +240,6 @@ class GPR():
fmin_l_bfgs_b(self.neg_log_marginal_likelihood,
theta_initial,
bounds=self.kernel.theta_bounds)
if convergence_dict["warnflag"] != 0:
warnings.warn("fmin_l_bfgs_b terminated abnormally with the "
" state: %s" % convergence_dict)
return theta_opt, func_min
def numerical_neg_lml(self, dx=1e-4):
......
import numpy as np
from ase.calculators.dftb import Dftb
from ase.io import read
from surrogate.gpr import GPR
from ase.io import read, write
from candidate_operations.candidate_generation import CandidateGenerator, StartGenerator, OperationConstraint
from candidate_operations.basic_mutations import RattleMutation, RattleMutation2, PermutationMutation
from gofee import GOFEE
import sys
from gofee import GOFEE
### Set up StartGenerator and mutations ###
# read slab
slab = read('slab.traj', index='0')
......@@ -33,14 +30,10 @@ sg = StartGenerator(slab, stoichiometry, box)
# initialize rattle mutation
n_to_optimize = len(stoichiometry)
# Add position constraint to mutations
z_constraint = OperationConstraint(zlim=[6.5, 15])
candidate_generator = CandidateGenerator([0.2, 0.2, 0.6],
[sg,
PermutationMutation(n_to_optimize, Npermute=2),
RattleMutation(n_to_optimize, Nrattle=3, rattle_range=4)])
[sg,
PermutationMutation(n_to_optimize, Npermute=2),
RattleMutation(n_to_optimize, Nrattle=3, rattle_range=4)])
### Define calculator ###
calc = Dftb(label='TiO2_surface',
......@@ -54,16 +47,14 @@ calc = Dftb(label='TiO2_surface',
kpts=(2,1,1))
### Initialize and run search ###
search = GOFEE(structures=None,
calc=calc,
gpr=None,
search = GOFEE(calc=calc,
startgenerator=sg,
candidate_generator=candidate_generator,
max_steps=200,
dmax_cov=1.5,
max_relax_dist=4,
population_size=5,
kappa=1,
dualpoint=True,
restart='restart')
search.run()
search.run()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment