Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e705135
New features: interpolation with tabulated potential, frame parameter…
Jun 17, 2019
b6abce1
grad in one shared lib
Jun 18, 2019
1d06357
human readable input/output shape
Jun 18, 2019
d1f5e36
infer nframes, simpified models. only compatible to higher versions o…
Jun 18, 2019
4bc9383
git ignore output files in lmp and train examples
Jun 18, 2019
68f03eb
implement radial only smooth descriptor
Jun 20, 2019
5b1e072
new variable name convention
Jun 21, 2019
b721960
implement models in seperate classes, add tests for them
Jun 21, 2019
a874358
split model and trainer
Jun 21, 2019
dbfad89
implement model se_r and se_ar
Jun 23, 2019
66c9758
remove outdated assertion
Jun 23, 2019
389e6da
virtual env should not use system packages
Jun 23, 2019
d035834
seperate DescrptSeA from ModelSeA
Jun 27, 2019
b80fe66
seperate descrptors and energy fitting from model
Jun 27, 2019
62d91ad
update tests, add json for se_r
Jun 27, 2019
8c5edbb
new parameter convention
Jun 27, 2019
ac812ba
rearrange examples
Jun 28, 2019
01e9729
make short-range table work
Jun 28, 2019
d61d405
bug fixing: fparam does not work with multiple atom types
Jun 28, 2019
0498fa0
bug fixing: srtab testing conficting namescope
Jun 28, 2019
0e432bd
add unittest for fparam test
Jun 28, 2019
55d736a
ignore build dirs
Jun 28, 2019
dc3ce46
merge cherry-pick rm train/Test.py
Jul 3, 2019
d616ab4
fix bug in setup
Jul 11, 2019
5d1b322
rename norot -> se_a
Jul 11, 2019
7c6c819
change name norot -> se_a
Jul 11, 2019
0e85c1a
build_interaction -> build
Jul 12, 2019
49e38c0
seperate loss and learning rate from trainer
Jul 12, 2019
5092763
change version format
Jul 12, 2019
59b950a
rm outdated test
Jul 12, 2019
a57e423
add example for short-range tab
Jul 12, 2019
3a24677
add example for fparam
Jul 12, 2019
08ea073
Merge branch 'rename'
Jul 12, 2019
c408edb
mv data/water to data/
Jul 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@
*.pyc
CMakeCache.txt
CMakeFiles
*.bk
build
_skbuild
deepmd.egg-info
dist

202 changes: 119 additions & 83 deletions README.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions data/raw/raw_to_set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ test -f energy.raw && split energy.raw -l $nline_per_set -d -a 3 energy.raw
test -f force.raw && split force.raw -l $nline_per_set -d -a 3 force.raw
test -f virial.raw && split virial.raw -l $nline_per_set -d -a 3 virial.raw
test -f atom_ener.raw && split atom_ener.raw -l $nline_per_set -d -a 3 atom_ener.raw
test -f fparam.raw && split fparam.raw -l $nline_per_set -d -a 3 fparam.raw

nset=`ls | grep box.raw[0-9] | wc -l`
nset_1=$(($nset-1))
Expand All @@ -32,6 +33,7 @@ do
test -f force.raw$pi && mv force.raw$pi set.$pi/force.raw
test -f virial.raw$pi && mv virial.raw$pi set.$pi/virial.raw
test -f atom_ener.raw$pi && mv atom_ener.raw$pi set.$pi/atom_ener.raw
test -f fparam.raw$pi && mv fparam.raw$pi set.$pi/fparam.raw

cd set.$pi
python -c 'import numpy as np; data = np.loadtxt("box.raw" ); data = data.astype (np.float32); np.save ("box", data)'
Expand Down Expand Up @@ -63,6 +65,13 @@ if os.path.isfile("atom_ener.raw"):
data = np.loadtxt("atom_ener.raw");
data = data.astype (np.float32);
np.save ("atom_ener", data)
'
python -c \
'import numpy as np; import os.path;
if os.path.isfile("fparam.raw"):
data = np.loadtxt("fparam.raw");
data = data.astype (np.float32);
np.save ("fparam", data)
'
rm *.raw
cd ../
Expand Down
15 changes: 0 additions & 15 deletions doc/install-tf.1.12.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# Install tensorflow's Python interface
We follow the virtual environment approach to install the tensorflow's Python interface. The full instruction can be found on [the tensorflow's official website](https://www.tensorflow.org/install/pip). Now we assume that the Python interface will be installed to virtual environment directory `$tensorflow_venv`
```bash
virtualenv --system-site-packages -p python3 $tensorflow_venv
source $tensorflow_venv/bin/activate
pip install --upgrade pip
pip install --upgrade tensorflow==1.12.0
```
To verify the installation,
```bash
python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
```

One should remember to activate the virtual environment every time he/she runs deepmd training program `dp_train`.

# Install tensorflow's C++ interface
The tensorflow's C++ interface will be compiled from the source code. Firstly one installs bazel. It is highly recommended that the bazel version 0.15.0 is used. A full instruction of bazel installation can be found [here](https://docs.bazel.build/versions/master/install.html).
```bash
Expand Down
15 changes: 0 additions & 15 deletions doc/install-tf.1.8.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# Install tensorflow's Python interface
We follow the virtual environment approach to install the tensorflow's Python interface. The full instruction can be found on [the tensorflow's official website](https://www.tensorflow.org/install/pip). Now we assume that the Python interface will be installed to virtual environment directory `$tensorflow_venv`
```bash
virtualenv --system-site-packages -p python3 $tensorflow_venv
source $tensorflow_venv/bin/activate
pip install --upgrade pip
pip install --upgrade tensorflow==1.8.0
```
To verify the installation,
```bash
python -c "import tensorflow as tf; sess=tf.Session(); print(sess.run(tf.reduce_sum(tf.random_normal([1000, 1000]))))"
```

One should remember to activate the virtual environment every time he/she runs deepmd training program `dp_train`.

# Install tensorflow's C++ interface
The tensorflow's C++ interface will be compiled from the source code. Firstly one installs bazel. It is highly recommended that the bazel version 0.10.0 is used. A full instruction of bazel installation can be found [here](https://docs.bazel.build/versions/master/install.html).
```bash
Expand Down
2 changes: 2 additions & 0 deletions examples/fparam/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*raw

Binary file added examples/fparam/data/e3000_i2000/set.000/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.000/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.000/fparam.npy
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.001/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.001/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.001/fparam.npy
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.002/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.002/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e3000_i2000/set.002/fparam.npy
Binary file not shown.
54 changes: 54 additions & 0 deletions examples/fparam/data/e3000_i2000/type.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Binary file added examples/fparam/data/e8000_i2000/set.000/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.000/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.000/fparam.npy
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.001/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.001/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.001/fparam.npy
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.002/box.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.002/energy.npy
Binary file not shown.
Binary file not shown.
Binary file added examples/fparam/data/e8000_i2000/set.002/fparam.npy
Binary file not shown.
54 changes: 54 additions & 0 deletions examples/fparam/data/e8000_i2000/type.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3 changes: 3 additions & 0 deletions examples/fparam/lmp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
frozen_model.pb
log.lammps
*dump*
64 changes: 64 additions & 0 deletions examples/fparam/lmp/conf.lmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

54 atoms
1 atom types
0.0000000000 10.4280799300 xlo xhi
0.0000000000 10.4280799300 ylo yhi
0.0000000000 10.4280799300 zlo zhi
0.0000000000 0.0000000000 0.0000000000 xy xz yz

Atoms # atomic

1 1 0.4643750000 0.3949230000 10.2940500000
2 1 3.5348720000 0.2520400000 10.3158220000
3 1 7.2324620000 0.1228930000 10.1355050000
4 1 9.9507070000 3.2752620000 0.0515780000
5 1 3.3706880000 3.3152460000 10.3646920000
6 1 6.7449020000 3.3255490000 10.2638940000
7 1 0.0488410000 6.7351830000 10.3711260000
8 1 3.4651590000 7.0327210000 0.1006810000
9 1 6.9307650000 6.6957410000 0.1507120000
10 1 10.1233330000 0.1368890000 3.3011780000
11 1 3.3081460000 0.0219510000 3.4692380000
12 1 7.1162540000 10.0116820000 3.8228820000
13 1 10.2833810000 3.3816330000 3.5961620000
14 1 3.6750080000 3.1843190000 3.9967240000
15 1 6.9892550000 3.2920210000 3.6984440000
16 1 0.4982230000 7.2412900000 3.2778060000
17 1 3.5704530000 6.5520740000 3.4567950000
18 1 6.8032210000 7.0392460000 3.4280710000
19 1 10.3091590000 0.0994260000 6.8924220000
20 1 3.4370550000 10.3684960000 6.9731360000
21 1 7.2526880000 9.9857130000 7.1602920000
22 1 9.9882210000 3.8193700000 6.5101540000
23 1 3.3795490000 3.8468420000 6.9077400000
24 1 6.6164890000 3.2631720000 6.7142520000
25 1 10.1576680000 7.1165020000 7.2578040000
26 1 3.3743670000 6.9032890000 6.7801200000
27 1 7.1298310000 6.9588770000 7.2617850000
28 1 1.5422020000 2.1329710000 1.5503380000
29 1 5.6699180000 1.1054690000 1.7107510000
30 1 8.5130900000 1.7898790000 1.6984680000
31 1 1.9555310000 5.0886780000 1.5922740000
32 1 5.4747010000 4.8624430000 1.7339950000
33 1 8.9310980000 5.1557250000 1.8983040000
34 1 2.0521660000 8.8521970000 1.9591310000
35 1 5.0983580000 8.5203820000 1.4825890000
36 1 8.8847120000 8.4793550000 1.6471070000
37 1 1.8016150000 1.6971370000 5.4598140000
38 1 5.5814970000 1.4779090000 4.8725800000
39 1 8.7363780000 1.5159260000 5.4921280000
40 1 1.3323340000 5.5041190000 5.5846390000
41 1 5.4108570000 5.1845870000 5.4133500000
42 1 8.3963130000 5.5316890000 5.1707350000
43 1 1.6428930000 9.0357440000 5.3812830000
44 1 5.1413850000 8.5704560000 5.1667500000
45 1 8.9848480000 8.1466110000 5.0493800000
46 1 1.3577270000 2.2488970000 8.1097190000
47 1 4.9511170000 1.9240540000 8.3422290000
48 1 8.5515580000 2.2705350000 8.3764730000
49 1 1.7533270000 5.3976920000 8.8873150000
50 1 5.0125090000 5.4878990000 8.8070480000
51 1 8.6850970000 4.9585190000 8.8666720000
52 1 1.7618510000 8.6701780000 8.7299850000
53 1 5.1786470000 8.9149870000 8.5980960000
54 1 9.0434810000 9.0196510000 9.0660600000
25 changes: 25 additions & 0 deletions examples/fparam/lmp/in.lammps
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# bulk water

units metal
boundary p p p
atom_style atomic

neighbor 2.0 bin
neigh_modify every 10 delay 0 check no

read_data conf.lmp
mass 1 16

# pair_style deepmd frozen_model.pb fparam 0.68938740
pair_style deepmd frozen_model.pb fparam 0.25852028
pair_coeff

velocity all create 2000 23456789

fix 1 all nvt temp 2000 2000 0.5
timestep 0.0005
thermo_style custom step pe ke etotal temp press vol
thermo 100
dump 1 all custom 100 traj.dump id type x y z fx fy fz

run 1000
5 changes: 5 additions & 0 deletions examples/fparam/train/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*out
model.ckpt*
frozen_model.pb
checkpoint

62 changes: 62 additions & 0 deletions examples/fparam/train/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"_comment": " model parameters",
"model" : {
"descriptor": {
"type": "se_a",
"sel": [60],
"rcut_smth": 1.80,
"rcut": 6.00,
"neuron": [25, 50, 100],
"resnet_dt": false,
"axis_neuron": 8,
"seed": 1
},
"fitting_net" : {
"neuron": [120, 120, 120],
"resnet_dt": true,
"numb_fparam": 1,
"seed": 1
}
},

"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
},

"learning_rate" : {
"start_lr": 0.001,
"decay_steps": 5000,
"decay_rate": 0.95
},

"_comment": " traing controls",
"training" : {
"systems": ["../data/e3000_i2000/", "../data/e8000_i2000/"],
"set_prefix": "set",
"stop_batch": 1000000,
"batch_size": 1,

"seed": 1,

"_comment": " display and restart",
"_comment": " frequencies counted in batch",
"disp_file": "lcurve.out",
"disp_freq": 100,
"numb_test": 10,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"load_ckpt": "model.ckpt",
"disp_training":true,
"time_training":true,
"profiling": false,
"profiling_file": "timeline.json"
},

"_comment": "that's all"
}

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions examples/water/lmp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
log.lammps
*.pb
*.dump
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions examples/water/train/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.out
*.pb
model.ckpt*
checkpoint
Loading