Commit fd6fde15 authored by Adam Fekete's avatar Adam Fekete

update notebook

parent df7498eb
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -402,7 +402,7 @@ def cov_sim_tries(a, b, sig): # SO(3) linear covariant kernel
ri, rj = np.sqrt(ris), np.sqrt(rjs)
# take only particles within the first shell
cut = 4.17
cut = 4.5
a, b = a[ri<= cut], b[rj <= cut]
ris, rjs = ris[ri<= cut], rjs[rj <= cut]
ri, rj = ri[ri<= cut], rj[rj <= cut]
......
from ML_of_Forces.DataModel import ForceConfs
from ML_of_Forces.GP_custom_gen import GaussianProcess3 as GPvec
import numpy as np
from ML_of_Forces.ManyBodyExpansion import MBExp
data = ForceConfs()
data.read_json_data(filename='../data-mlforce/Si_TB_300K.json')
train_confs, train_force, test_confs, test_force = data.subsampling(30, 10, random=True)
train_confs, train_force, test_confs, test_force = data.subsampling(40, 10, random=True)
gp = GPvec(
ker=['id'],
fvecs=['cov_sim'],
nugget=1e-8,
theta0=np.array([None]),
sig=.5,
bounds=((0.1, 10.),),
optimizer=None,
calc_error=True,
eval_grad=False,
)
gp.fit(train_confs, train_force)
pred_force, var_force = gp.predict(test_confs)
# print(pred_force)
# print(test_force)
# error = np.sqrt(np.sum((pred_force - test_force)**2, axis=1))
# print(error.shape)
# print(var_force)
# print(train_confs)
fit = MBExp(gp)
fit.PW_S_fit(0.1,4)
print(train_confs)numpy
\ No newline at end of file
fit.pair_potential_scalars(0.1, 4, Delta_d=0.1)
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