Beispiel #1
0
    "zeta": 220.127,
    "eta": 30.8065
}
estimator = ARMP(iterations=200,
                 representation_name='acsf',
                 representation_params=acsf_params,
                 tensorboard=True,
                 store_frequency=10,
                 l1_reg=0.0001,
                 l2_reg=0.005,
                 learning_rate=0.0005)

estimator.set_properties(ene)
estimator.generate_representation(xyz, zs)

saved_dir = "saved_model"

estimator.load_nn(saved_dir)

idx = list(range(n_samples))

estimator.fit(idx)

pred_1 = estimator.predict(idx)
pred_2 = estimator.predict_from_xyz(xyz, zs)

# plt.scatter(pred_1, pred_2)
# plt.show()

# estimator.save_nn()
Beispiel #2
0
print("Generated the representations")
print(estimator.representation.shape)

idx = list(range(n_samples))
idx_train, idx_test = modsel.train_test_split(idx,
                                              random_state=42,
                                              shuffle=True)

estimator.fit(idx_train)

data_squal = h5py.File(
    "/Volumes/Transcend/data_sets/CN_squalane/dft/squalane_cn_dft.hdf5", "r")

xyz_squal = np.array(data_squal.get("xyz")[:10])
zs_squal = np.array(data_squal.get("zs")[:10], dtype=np.int32)
ene_squal = np.array(data_squal.get("ene")[:10]) * 2625.50
ene_squal = ene_squal - ref_ene

estimator.score(idx_test)

pred1 = estimator.predict_from_xyz(xyz_squal, zs_squal)
print("Done squal pred")
pred2 = estimator.predict(idx_test)

# estimator.save_nn()
#
# print(pred1)
# print(pred2)
#
plt.scatter(pred2, pred1)
plt.show()
Beispiel #3
0
data = h5py.File("/Volumes/Transcend/data_sets/CN_isopentane/pruned_dft_with_forces/pruned_isopentane_cn_dft.hdf5", "r")

n_samples = 500

xyz = np.array(data.get("xyz")[-n_samples:])
ene = np.array(data.get("ene")[-n_samples:])*2625.50
ene = ene - data.get("ene")[0]*2625.50
zs = np.array(data["zs"][-n_samples:], dtype=np.int32)

# Creating the estimator
acsf_param = {"nRs2": 5, "nRs3": 5, "nTs": 5, "rcut": 5, "acut": 5, "zeta": 220.127, "eta": 30.8065}
estimator = ARMP(iterations=1000, batch_size=512, l1_reg=0.0, l2_reg=0.0, learning_rate=0.001, representation_name='acsf',
                 representation_params=acsf_param, tensorboard=False, store_frequency=50)
estimator.set_properties(ene)
estimator.generate_representation(xyz, zs, method='fortran')
print(estimator.g.shape)

# Doing cross validation
idx = list(range(n_samples))
idx_train, idx_test = modsel.train_test_split(idx, test_size=0.15, random_state=42, shuffle=False)

print("Starting the fitting...")
estimator.fit(idx_train)

# estimator.save_nn("saved_model")

pred1 = estimator.predict(idx_train)
pred2 = estimator.predict_from_xyz(xyz[idx_train], zs[idx_train])