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(): ...@@ -335,11 +335,13 @@ class GOFEE():
relaxed_candidates = self.certainty_filter(relaxed_candidates) relaxed_candidates = self.certainty_filter(relaxed_candidates)
relaxed_candidates = self.population.pop_MLrelaxed + relaxed_candidates relaxed_candidates = self.population.pop_MLrelaxed + relaxed_candidates
"""
if self.master: if self.master:
Epred = np.array([a.info['key_value_pairs']['Epred'] for a in relaxed_candidates]) 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]) Epred_std = np.array([a.info['key_value_pairs']['Epred_std'] for a in relaxed_candidates])
fitness = Epred - self.kappa*Epred_std fitness = Epred - self.kappa*Epred_std
print(np.c_[Epred, Epred_std, fitness]) print(np.c_[Epred, Epred_std, fitness])
"""
return relaxed_candidates return relaxed_candidates
def generate_candidate(self): def generate_candidate(self):
......
...@@ -240,9 +240,6 @@ class GPR(): ...@@ -240,9 +240,6 @@ class GPR():
fmin_l_bfgs_b(self.neg_log_marginal_likelihood, fmin_l_bfgs_b(self.neg_log_marginal_likelihood,
theta_initial, theta_initial,
bounds=self.kernel.theta_bounds) 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 return theta_opt, func_min
def numerical_neg_lml(self, dx=1e-4): def numerical_neg_lml(self, dx=1e-4):
......
import numpy as np import numpy as np
from ase.calculators.dftb import Dftb 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.candidate_generation import CandidateGenerator, StartGenerator, OperationConstraint
from candidate_operations.basic_mutations import RattleMutation, RattleMutation2, PermutationMutation from candidate_operations.basic_mutations import RattleMutation, RattleMutation2, PermutationMutation
from gofee import GOFEE
import sys import sys
from gofee import GOFEE
### Set up StartGenerator and mutations ### ### Set up StartGenerator and mutations ###
# read slab # read slab
slab = read('slab.traj', index='0') slab = read('slab.traj', index='0')
...@@ -33,10 +30,6 @@ sg = StartGenerator(slab, stoichiometry, box) ...@@ -33,10 +30,6 @@ sg = StartGenerator(slab, stoichiometry, box)
# initialize rattle mutation # initialize rattle mutation
n_to_optimize = len(stoichiometry) 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], candidate_generator = CandidateGenerator([0.2, 0.2, 0.6],
[sg, [sg,
PermutationMutation(n_to_optimize, Npermute=2), PermutationMutation(n_to_optimize, Npermute=2),
...@@ -54,13 +47,11 @@ calc = Dftb(label='TiO2_surface', ...@@ -54,13 +47,11 @@ calc = Dftb(label='TiO2_surface',
kpts=(2,1,1)) kpts=(2,1,1))
### Initialize and run search ### ### Initialize and run search ###
search = GOFEE(structures=None, search = GOFEE(calc=calc,
calc=calc,
gpr=None,
startgenerator=sg, startgenerator=sg,
candidate_generator=candidate_generator, candidate_generator=candidate_generator,
max_steps=200, max_steps=200,
dmax_cov=1.5, max_relax_dist=4,
population_size=5, population_size=5,
kappa=1, kappa=1,
dualpoint=True, dualpoint=True,
......
Supports Markdown
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