Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Development to master #218

Merged
merged 88 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
98b00be
fix capital
YuuuXie Jul 15, 2020
eb299b2
Merge branch 'development' of github.com:mir-group/flare into bugfix/…
YuuuXie Jul 15, 2020
ba6ad70
add otf_parser in test_otf.py
YuuuXie Jul 15, 2020
dbb6d11
change otf_parser
YuuuXie Jul 16, 2020
7eb8b75
reformatted
YuuuXie Jul 16, 2020
85e0153
debugged otf_parser
YuuuXie Jul 18, 2020
8e3b363
fix bug
YuuuXie Jul 18, 2020
f84e95e
Merge branch 'master' of https://github.com/mir-group/flare into bugf…
YuuuXie Jul 18, 2020
af99e49
fix test_otf
YuuuXie Jul 18, 2020
56f41c2
add back skipped tests
YuuuXie Jul 18, 2020
ec8105c
change ase output to xyz
YuuuXie Jul 18, 2020
2aca88c
add par flag in predict
YuuuXie Jul 18, 2020
6618a1c
add exclude indices / fix atoms
YuuuXie Jul 19, 2020
82b6972
rm redundant lines
YuuuXie Jul 21, 2020
35c0510
Merge branch 'bugfix/yu/otf_parser' of https://github.com/mir-group/f…
YuuuXie Jul 21, 2020
efdb37d
fix docs
YuuuXie Jul 24, 2020
25cbdbc
add print flags & comment
YuuuXie Jul 24, 2020
8008166
attemp to solve md issue
YuuuXie Jul 24, 2020
f7b0ead
Merge branch 'bugfix/yu/otf_parser' of github.com:mir-group/flare int…
YuuuXie Jul 24, 2020
1409672
add energy and stress arguments to update gp
jonpvandermause Jul 31, 2020
925856e
add energy and stress argument to ase otf
jonpvandermause Jul 31, 2020
6603d2c
add force noise property to gp
jonpvandermause Jul 31, 2020
4557d36
add hyps and labels property
jonpvandermause Jul 31, 2020
7bc7085
remove parameters from otf
jonpvandermause Jul 31, 2020
8d398f6
Merge branch 'master' into development
jonpvandermause Jul 31, 2020
185e665
fix hyps property
jonpvandermause Jul 31, 2020
0d1517b
fix 0 cutoff, close #167
YuuuXie Jul 31, 2020
a150b7e
fix err handler, close #208
YuuuXie Jul 31, 2020
115210d
write exchagne species to lmp 3b file
YuuuXie Aug 1, 2020
a88cf80
rm symmetry reduction & fixed mgp 3b stress prediction
YuuuXie Aug 2, 2020
f5748f3
add pair styles
YuuuXie Aug 2, 2020
fdadf28
pull dev
YuuuXie Aug 2, 2020
3b017bb
revert otf back to dev
YuuuXie Aug 2, 2020
16658ba
debugged otf_parser
YuuuXie Aug 2, 2020
458a8e0
reformat
YuuuXie Aug 2, 2020
e976efc
change default value
YuuuXie Aug 2, 2020
5ee1188
add grid
YuuuXie Aug 2, 2020
f1a37e0
skip cp2k in parse otf
YuuuXie Aug 2, 2020
d481f01
adapt to the ase step
YuuuXie Aug 2, 2020
d90b5ad
add forces, eenergy, stress to from/to_ase_atoms, close #158
YuuuXie Aug 3, 2020
1c4c3c6
Merge branch 'bugfix/yu/otf_parser' of https://github.com/mir-group/f…
YuuuXie Aug 3, 2020
70a3ccf
re-make gp in the test_otf_parser func
YuuuXie Aug 3, 2020
7654aab
fix frame:0 order
YuuuXie Aug 3, 2020
0df4f81
add replicate gp
YuuuXie Aug 3, 2020
bca7232
rm redundant import
YuuuXie Aug 3, 2020
1ca9c25
add as_dict & checkpoint
YuuuXie Aug 3, 2020
3ddaae2
add from_checkpoint in otf
YuuuXie Aug 3, 2020
d77c2cd
adapt otf_parser to the checkpt file
YuuuXie Aug 3, 2020
e3aa2c0
add as_dict/from_dict
YuuuXie Aug 3, 2020
dd51b0c
wrap write_model as a function
YuuuXie Aug 3, 2020
6303252
add cleanup
YuuuXie Aug 3, 2020
93fee02
ase otf dump checkpoint
YuuuXie Aug 3, 2020
cdac004
reformat
YuuuXie Aug 3, 2020
73bb156
add ase otf from file
YuuuXie Aug 3, 2020
31ac26f
Merge branch 'bugfix/yu/mgp' of https://github.com/mir-group/flare in…
YuuuXie Aug 3, 2020
ba79955
rm print flag
YuuuXie Aug 3, 2020
1b1880c
Merge branch 'bugfix/yu/mgp' of https://github.com/mir-group/flare in…
YuuuXie Aug 3, 2020
d90a0ab
fix write_model duplicated names
YuuuXie Aug 4, 2020
280b17d
add compatibility with Trajectory
YuuuXie Aug 4, 2020
d601559
fix backward compatibility
YuuuXie Aug 4, 2020
0b52b27
change default value
YuuuXie Aug 4, 2020
b4da61e
sync hyps mask
YuuuXie Aug 4, 2020
7e4606c
solve conflict of dumping self.md
YuuuXie Aug 4, 2020
7ff733e
debugging NPT
YuuuXie Aug 4, 2020
f8307c6
add 'continue' when training set contains isolated atoms
YuuuXie Aug 4, 2020
bf6f1ab
Merge branch 'bugfix/yu/mgp' of https://github.com/mir-group/flare in…
YuuuXie Aug 4, 2020
be60984
add hyps_mask
YuuuXie Aug 4, 2020
d931a6b
add max dist check in mgp preidct
YuuuXie Aug 4, 2020
ab2b7e0
enlarge cell size
YuuuXie Aug 4, 2020
872d155
don't cleanup before all tests are done
YuuuXie Aug 4, 2020
465547f
remove comment
YuuuXie Aug 5, 2020
1e8cf74
update tutorials
YuuuXie Aug 5, 2020
5d9358a
mv the directory of pair_mgp files
YuuuXie Aug 6, 2020
69516d4
Merge pull request #215 from mir-group/bugfix/yu/mgp
YuuuXie Aug 6, 2020
fd56141
Merge branch 'development' of https://github.com/mir-group/flare into…
YuuuXie Aug 6, 2020
d7b6e68
Merge branch 'bugfix/yu/ase_otf' of https://github.com/mir-group/flar…
YuuuXie Aug 6, 2020
2b29de7
skip cp2k temporarily
YuuuXie Aug 6, 2020
f09a6d4
update docs and tutorials
YuuuXie Aug 7, 2020
7948318
fix a bug in otf if write_model > 1
YuuuXie Aug 11, 2020
a79ea24
fix a bug in as_dict/from_dict
YuuuXie Aug 12, 2020
243432d
change to
YuuuXie Aug 12, 2020
a6c2006
pop output in as_dict,
YuuuXie Aug 12, 2020
882c35e
a tricky bug where the name cannot be found in _global_training_data …
YuuuXie Aug 12, 2020
ad0530b
change set_calculator to atom.calc, & set default to not parallelize …
YuuuXie Aug 12, 2020
7f4e175
remove communicator
YuuuXie Aug 13, 2020
4584eda
fix from_dict when mgp_model=None
YuuuXie Aug 13, 2020
73fbc39
Merge branch 'bugfix/yu/ase_otf' of github.com:mir-group/flare into b…
YuuuXie Aug 13, 2020
6c70995
Merge pull request #214 from mir-group/bugfix/yu/ase_otf
YuuuXie Aug 18, 2020
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
85 changes: 45 additions & 40 deletions docs/source/tutorials/after_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -45,24 +45,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Final name of the gp instance is default_gp_2\n"
]
}
],
"outputs": [],
"source": [
"gp_model = otf_object.make_gp(hyp_no=hyp_no)\n",
"gp_model.parallel = True\n",
"gp_model.hyp_labels = ['sig2', 'ls2', 'sig3', 'ls3', 'noise']\n",
"\n",
"# write model to a binary file\n",
"gp_model.write_model('AgI.gp', format='pickle')"
"gp_model.write_model('AgI.gp', format='json')"
]
},
{
Expand All @@ -75,21 +67,13 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Final name of the gp instance is default_gp_2_2\n"
]
}
],
"outputs": [],
"source": [
"from flare.gp import GaussianProcess\n",
"\n",
"gp_model = GaussianProcess.from_file('AgI.gp.pickle')"
"gp_model = GaussianProcess.from_file('AgI.gp.json')"
]
},
{
Expand All @@ -106,20 +90,33 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/xiey/Google Drive/flare/flare/mgp/mapxb.py:525: UserWarning: The minimal distance in training data is lower than the current lower bound, will reset lower bound to 2.129780094032895\n",
" f\"The minimal distance in training data is lower than \"\n",
"/Users/xiey/Google Drive/flare/flare/mgp/mapxb.py:525: UserWarning: The minimal distance in training data is lower than the current lower bound, will reset lower bound to 2.129780094032895\n",
" f\"The minimal distance in training data is lower than \"\n",
"/Users/xiey/Google Drive/flare/flare/mgp/mapxb.py:525: UserWarning: The minimal distance in training data is lower than the current lower bound, will reset lower bound to 2.129780094032895\n",
" f\"The minimal distance in training data is lower than \"\n"
]
}
],
"source": [
"from flare.mgp import MappedGaussianProcess\n",
"\n",
"grid_params = {'twobody': {'grid_num': [64]}, \n",
" 'threebody': {'grid_num': [20, 20, 20]}}\n",
"\n",
"data = gp_model.training_statistics\n",
"lammps_location = 'AgI_Molten_15.txt'\n",
"lammps_location = 'AgI_Molten'\n",
"\n",
"mgp_model = MappedGaussianProcess(grid_params, data['species'], \n",
" map_force=False, lmp_file_name='AgI_Molten_15.txt', n_cpus=1)\n",
" var_map=None, lmp_file_name='AgI_Molten', n_cpus=1)\n",
"mgp_model.build_map(gp_model)"
]
},
Expand All @@ -145,28 +142,36 @@
"pair_coeff * * <lmp_file_name> <chemical_symbols> yes/no yes/no\n",
"```\n",
"\n",
"An example is using coefficient file `AgI_Molten_15.txt` for AgI system, \n",
"An example is using coefficient file `AgI_Molten.mgp` for AgI system, \n",
"with two-body (the 1st `yes`) together with three-body (the 2nd `yes`).\n",
"\n",
"```\n",
"pair_coeff * * AgI_Molten_15.txt Ag I yes yes\n",
"```\n",
"\n",
"**Note**: if you build force mapping (`map_force=True`) instead of energy mapping, please use\n",
"```\n",
"pair_style mgpf\n",
"pair_coeff * * AgI_Molten.mgp Ag I yes yes\n",
"```\n",
"\n",
"2. The third way is to use the ASE LAMMPS interface"
"2. Another way is to use the ASE LAMMPS interface"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/xiey/anaconda3/lib/python3.7/site-packages/ase/calculators/lammpsrun.py:189: UserWarning: You are using an old syntax to set 'parameters'.\n",
"Please use LAMMPSRUN.set().\n",
" warnings.warn(self.legacy_warn_string.format(\"parameters\"))\n"
]
}
],
"source": [
"import os\n",
"from flare.utils.element_coder import _Z_to_mass, _element_to_Z\n",
"from flare.ase.calculator import FLARE_Calculator\n",
"from ase.calculators.lammpsrun import LAMMPS\n",
"\n",
"# get chemical symbols, masses etc.\n",
"species = gp_model.training_statistics['species']\n",
Expand All @@ -177,9 +182,9 @@
"parameters = {'command': os.environ.get('lmp'), # set up executable for ASE\n",
" 'newton': 'off',\n",
" 'pair_style': 'mgp',\n",
" 'pair_coeff': [f'* * {lammps_location} {specie_symbol_list} yes yes'],\n",
" 'pair_coeff': [f'* * {lammps_location + \".mgp\"} {specie_symbol_list} yes yes'],\n",
" 'mass': masses}\n",
"files = [lammps_location]\n",
"files = [lammps_location + \".mgp\"]\n",
"\n",
"# create ASE calc\n",
"lmp_calc = LAMMPS(label=f'tmp_AgI', keep_tmp_files=True, tmp_dir='./tmp/',\n",
Expand All @@ -190,7 +195,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"3. The second way to run LAMMPS is using our LAMMPS interface, please set the\n",
"3. The third way to run LAMMPS is using our LAMMPS interface, please set the\n",
"environment variable `$lmp` to the executable."
]
},
Expand Down
Loading