-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from Exabyte-io/feat/SOF-7194
SOF-7194: preliminary deepmd support on the web platform
- Loading branch information
Showing
22 changed files
with
233 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: deepmd | ||
shortName: deepmd | ||
summary: DeePMD | ||
defaultVersion: '2.0.2' | ||
versions: | ||
- version: '2.0.2' | ||
isDefault: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"model": { | ||
"type_map": [ | ||
"O", | ||
"H" | ||
], | ||
"descriptor": { | ||
"type": "se_e2_r", | ||
"sel": [ | ||
23, | ||
46 | ||
], | ||
"rcut_smth": 0.50, | ||
"rcut": 5.00, | ||
"neuron": [ | ||
5, | ||
5, | ||
5 | ||
], | ||
"resnet_dt": false, | ||
"seed": 1 | ||
}, | ||
"fitting_net": { | ||
"neuron": [ | ||
60, | ||
60, | ||
60 | ||
], | ||
"resnet_dt": true, | ||
"seed": 1 | ||
} | ||
}, | ||
"learning_rate": { | ||
"type": "exp", | ||
"decay_steps": 1000, | ||
"start_lr": 0.005, | ||
"stop_lr": 3.51e-6 | ||
}, | ||
"loss": { | ||
"start_pref_e": 0.02, | ||
"limit_pref_e": 1, | ||
"start_pref_f": 1000, | ||
"limit_pref_f": 1, | ||
"start_pref_v": 0, | ||
"limit_pref_v": 0 | ||
}, | ||
"training": { | ||
"training_data": { | ||
"systems": [ | ||
"./training/" | ||
], | ||
"batch_size": "auto" | ||
}, | ||
"validation_data": { | ||
"systems": [ | ||
"./validation/" | ||
], | ||
"batch_size": "auto" | ||
}, | ||
"numb_steps": 301, | ||
"seed": 1, | ||
"disp_file": "lcurve.out", | ||
"disp_freq": 10, | ||
"numb_test": 1, | ||
"save_freq": 100 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import dpdata | ||
import numpy as np | ||
|
||
# https://docs.deepmodeling.com/projects/dpdata/en/master/formats/QECPTrajFormat.html | ||
data = dpdata.LabeledSystem("cp", fmt="qe/cp/traj") | ||
print("Dataset contains total {0} frames".format(len(data))) | ||
|
||
# randomly choose 20% index for validation_data | ||
size = len(data) | ||
size_validation = round(size * 0.2) | ||
|
||
index_validation = np.random.choice(size, size=size_validation, replace=False) | ||
index_training = list(set(range(size)) - set(index_validation)) | ||
|
||
data_training = data.sub_system(index_training) | ||
data_validation = data.sub_system(index_validation) | ||
|
||
print("Using {0} frames as training set".format(len(data_training))) | ||
print("Using {0} frames as validation set".format(len(data_validation))) | ||
|
||
# save training and validation sets | ||
data_training.to_deepmd_npy("./training") | ||
data_validation.to_deepmd_npy("./validation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import dpdata | ||
|
||
# load cp data files | ||
# https://docs.deepmodeling.com/projects/dpdata/en/master/formats/QECPTrajFormat.html | ||
system = dpdata.LabeledSystem("cp", fmt="qe/cp/traj") | ||
|
||
# convert dpdata to lammps format | ||
# below procedure will convert input QE structure to lammps format, user may | ||
# want to generate supercell or other complex structure for lammps calculation | ||
system.to_lmp("system.lmp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# LAMMPS input, deepmd-kit version. Built from bulk water calculation. | ||
|
||
units metal | ||
boundary p p p | ||
atom_style atomic | ||
|
||
neighbor 2.0 bin | ||
neigh_modify every 10 delay 0 check no | ||
|
||
read_data system.lmp | ||
mass 1 16 | ||
mass 2 2 | ||
|
||
pair_style deepmd ./graph.pb | ||
pair_coeff * * | ||
|
||
velocity all create 330.0 23456789 | ||
|
||
fix 1 all nvt temp 330.0 330.0 0.5 | ||
timestep 0.0005 | ||
thermo_style custom step pe ke etotal temp press vol | ||
thermo 100 | ||
dump 1 all custom 100 system.dump id type x y z | ||
|
||
run 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
isDefault: false | ||
monitors: | ||
- standard_output | ||
results: [] | ||
flavors: | ||
dp_train_se_e2_r: | ||
input: | ||
- name: dp_train_se_e2_r.json | ||
results: [] | ||
monitors: | ||
- standard_output | ||
applicationName: deepmd | ||
executableName: dp # dp train dp_train_se_e2_r.json && dp freeze -o graph.pb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
isDefault: false | ||
monitors: | ||
- standard_output | ||
results: [] | ||
flavors: | ||
lammps_md: | ||
input: | ||
- name: in.lammps | ||
results: [] | ||
monitors: | ||
- standard_output | ||
applicationName: deepmd | ||
executableName: lmp # mpirun -np $NP lmp -in in.lammps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
isDefault: true | ||
monitors: | ||
- standard_output | ||
results: [] | ||
flavors: | ||
espresso_cp_to_deepmd: | ||
isDefault: true | ||
input: | ||
- name: espresso_cp_to_deepmd.py | ||
results: [] | ||
monitors: | ||
- standard_output | ||
applicationName: deepmd | ||
executableName: python | ||
|
||
espresso_to_lammps_structure: | ||
isDefault: false | ||
input: | ||
- name: espresso_to_lammps_structure.py | ||
results: [] | ||
monitors: | ||
- standard_output | ||
applicationName: deepmd | ||
executableName: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ monitors: | |
results: [] | ||
flavors: | ||
cp: | ||
isDefault: true | ||
input: | ||
- name: cp.in | ||
results: [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- content: !readFile 'assets/deepmd/espresso_to_lammps_structure.j2.py' | ||
name: espresso_to_lammps_structure.py | ||
contextProviders: [] | ||
applicationName: deepmd | ||
executableName: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- content: !readFile 'assets/deepmd/in.lammps' | ||
name: in.lammps | ||
contextProviders: [] | ||
applicationName: deepmd | ||
executableName: lmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- content: !readFile 'assets/deepmd/espresso_cp_to_deepmd.j2.py' | ||
name: espresso_cp_to_deepmd.py | ||
contextProviders: [] | ||
applicationName: deepmd | ||
executableName: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- content: !readFile 'assets/deepmd/dp_train_se_e2_r.j2.json' | ||
name: dp_train_se_e2_r.json | ||
contextProviders: [] | ||
applicationName: deepmd | ||
executableName: dp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters