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

[WIP] Development branch with many body feature and energy mapping #162

Merged
merged 375 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
375 commits
Select commit Hold shift + click to select a range
cc446dc
GPFA should now run with MGP
stevetorr Feb 14, 2020
ab355a8
added a first version of the hyperparameter optimisation for the many…
AldoGl Feb 14, 2020
f49ecab
fix unittest test_gp.py
nw13slx Feb 14, 2020
12c321e
many body kernels grads and merge
AldoGl Feb 15, 2020
21f5aac
add timer in unit test
nw13slx Feb 17, 2020
5f176ff
debugged many body kernel gradient
AldoGl Feb 17, 2020
c963b06
reinserted jit decorators
AldoGl Feb 17, 2020
63a00e0
clean up gp_algebra and debug
nw13slx Feb 17, 2020
0a5b0d2
update mgp with the global variables
nw13slx Feb 17, 2020
03c3b4a
Changes to GP serialization
stevetorr Feb 17, 2020
e15188a
Move closer to passing unit tests
stevetorr Feb 17, 2020
3aa9cfc
revise mc_sephyps to reduce dictionary operation and improve speed
nw13slx Feb 17, 2020
b1182a0
clean up and fix argument order
nw13slx Feb 17, 2020
96e194a
Update vasp_util.py
stevetorr Feb 17, 2020
c903d49
merge helper and util
nw13slx Feb 17, 2020
4108a47
Fix unit test
stevetorr Feb 17, 2020
5e0f0fb
Merge branch 'yu/energy_mgp' of https://github.com/mir-group/flare in…
stevetorr Feb 17, 2020
1cb4ff4
fix wrong argument for numpy array
nw13slx Feb 17, 2020
d4f963b
add notes
nw13slx Feb 17, 2020
ae67728
fix wrong import
nw13slx Feb 17, 2020
aacee39
fix triplemask problem
nw13slx Feb 17, 2020
9d398e8
merge with latest update in yu/energy and fix unit test
nw13slx Feb 17, 2020
6f0e10b
update argument names in unittest
nw13slx Feb 17, 2020
013a236
fix energy vector bug
nw13slx Feb 17, 2020
842b7e0
change the tolerance for isclose
nw13slx Feb 17, 2020
9bfaa8d
fix test error. shorten mgp_unit test
nw13slx Feb 18, 2020
5cc5d48
Merge branch 'master' of github.com:mir-group/flare into features/lix…
nw13slx Feb 18, 2020
8f087f2
fix the test set by setting random number seed
nw13slx Feb 18, 2020
e9bbd49
change n_cpus
YuuuXie Feb 18, 2020
0888973
add update for mgp_en
YuuuXie Feb 18, 2020
3afe5da
fix merge conflict
nw13slx Feb 18, 2020
d976542
add update
YuuuXie Feb 18, 2020
631cd60
small cleaning
YuuuXie Feb 18, 2020
064761f
Merge pull request #141 from mir-group/features/lixin/share_memory
YuuuXie Feb 18, 2020
dd863e9
move write_2/3_body into the sub-classes
YuuuXie Feb 18, 2020
416a173
Update docstring for spec mask
stevetorr Feb 18, 2020
67c984e
Changed bond map writing convention
stevetorr Feb 18, 2020
81c5f88
Merge branch 'yu/energy_mgp' of https://github.com/mir-group/flare in…
stevetorr Feb 18, 2020
a5624df
OTF now has write_model flag
stevetorr Feb 18, 2020
1134f3d
merge master
YuuuXie Feb 18, 2020
5a964f6
Added force energy many-body kernels
ClaudioZeni Feb 18, 2020
c7e3b5f
added force energy many body test
ClaudioZeni Feb 18, 2020
6e2bb11
initial version f many body mc kernels
AldoGl Feb 18, 2020
1bcb377
Fix logic (mirroring master)
stevetorr Feb 18, 2020
1d97ceb
Update vasp_util.py
stevetorr Feb 18, 2020
749dd87
Added 2+3+many single species force energy and energy kernels
ClaudioZeni Feb 18, 2020
b130d2f
Added many-body to str_to_kernel
ClaudioZeni Feb 18, 2020
dda6561
Merge branch 'yu/energy_mgp' of https://github.com/mir-group/flare in…
YuuuXie Feb 18, 2020
295ccaa
split into parts
YuuuXie Feb 19, 2020
3286f78
merge master
YuuuXie Feb 19, 2020
e1468ac
merge yu/energy_mgp
YuuuXie Feb 19, 2020
ea8ec8b
Merge branch 'yu/energy_mgp' of https://github.com/mir-group/flare in…
YuuuXie Feb 19, 2020
85054f7
merge yu/energy_mgp
YuuuXie Feb 19, 2020
402cdf8
merge fix
YuuuXie Feb 19, 2020
406a554
update
YuuuXie Feb 19, 2020
7438da1
add notes for kernels/utils
nw13slx Feb 19, 2020
b059393
Merge branch 'development' of github.com:mir-group/flare into develop…
YuuuXie Feb 19, 2020
f3a02cf
2+3+mb
AldoGl Feb 19, 2020
cc93c2d
Merge branch 'mb_simple' of github.com:mir-group/flare into mb_simple
AldoGl Feb 19, 2020
ca4ec88
Updated env to take into account species of neighbours of neighbours
ClaudioZeni Feb 19, 2020
9c65008
re-write test_stress file
YuuuXie Feb 19, 2020
eaf4ffc
re-write test_stress file
YuuuXie Feb 19, 2020
547783b
Updated many-body multi species kernel
ClaudioZeni Feb 19, 2020
0c3faaf
cleaned up ase unit test, shorten the time
YuuuXie Feb 20, 2020
5faa5f1
IMPORTANT! Removed r0 hyperparameter and changed descriptor to coordi…
ClaudioZeni Feb 20, 2020
16262c4
changed tests removing r0 hyperparameter
AldoGl Feb 20, 2020
c724788
fix import fake_gp
YuuuXie Feb 20, 2020
ef19fc6
Added many-body energy and bugfix
ClaudioZeni Feb 20, 2020
ae54c98
added tests and mb mc kernel grad
AldoGl Feb 20, 2020
d7ef0f7
merge
AldoGl Feb 20, 2020
e40b888
merge
AldoGl Feb 20, 2020
b5447a2
Bugfix
ClaudioZeni Feb 20, 2020
09df4aa
Added comments
stevetorr Feb 20, 2020
4911efa
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Feb 20, 2020
743727b
smallbugfix
AldoGl Feb 20, 2020
5f155ca
add import subprocess
YuuuXie Feb 20, 2020
93c7b09
change flare_calc to dict
YuuuXie Feb 20, 2020
83176ab
disable 'update'
YuuuXie Feb 20, 2020
2ceae62
Bugfix
ClaudioZeni Feb 20, 2020
7347a53
Bugfix
ClaudioZeni Feb 20, 2020
4fe9bf9
small change
AldoGl Feb 20, 2020
e64d904
re-added jit decorator
ClaudioZeni Feb 20, 2020
b54a062
Added force-energy many body kernel with test
ClaudioZeni Feb 20, 2020
6ad5f88
Added 2+3+many energy and force-energy wrappers
ClaudioZeni Feb 20, 2020
6770855
Added comments to many-body functions
ClaudioZeni Feb 21, 2020
5a66be0
Updated function comments many-body
ClaudioZeni Feb 21, 2020
d52af9c
Improved comments for mb_env
ClaudioZeni Feb 21, 2020
9fb7ab2
Merge branch 'mb_simple' of github.com:mir-group/flare into merge/mc_…
nw13slx Feb 21, 2020
9a0e66f
update utils for manybody kernels
nw13slx Feb 21, 2020
6a1bcbc
add unit test for stk
nw13slx Feb 21, 2020
c26c247
Cleaned up many body integration in kernels and mc_simple
ClaudioZeni Feb 21, 2020
5169a5a
resolve conflict test_mc_mb_kernel.py
nw13slx Feb 21, 2020
dd67a44
Merge branch 'merge/mc_simple+development' of github.com:mir-group/fl…
nw13slx Feb 21, 2020
776e07c
fix return error
nw13slx Feb 21, 2020
fa3f572
Merged many-body single component kernel tests
ClaudioZeni Feb 21, 2020
e5ec877
Merge remote-tracking branch 'origin/merge/mc_simple+development' int…
ClaudioZeni Feb 21, 2020
8292666
add the manybody string
nw13slx Feb 21, 2020
cdca8c1
Merge branch 'merge/mc_simple+development' of github.com:mir-group/fl…
nw13slx Feb 21, 2020
59c5a0a
total stress divided by volume
YuuuXie Feb 21, 2020
29253dd
train set saved to _global when gp loaded from_dict
YuuuXie Feb 21, 2020
e124396
change stress order to match ASE lmp calculator
YuuuXie Feb 21, 2020
cba7558
add pbc for to_ase_atoms
YuuuXie Feb 21, 2020
c6263a7
change test_stress to test_lmp
YuuuXie Feb 21, 2020
94a1921
Microbugfix
ClaudioZeni Feb 21, 2020
1e5bb73
Added to_xyz methods to struc
stevetorr Feb 22, 2020
4ba4788
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Feb 22, 2020
482834c
fix bug
YuuuXie Feb 23, 2020
08a9aba
rm tmp dir
YuuuXie Feb 23, 2020
e7141fa
fixed a bug in the many body many species kernel and gradient, genera…
AldoGl Feb 24, 2020
85b49fd
Merge branch 'merge/mc_simple+development' of github.com:mir-group/fl…
AldoGl Feb 24, 2020
9611c36
minor change for the interface
nw13slx Feb 24, 2020
b5196e1
Merge branch 'merge/mc_simple+development' of github.com:mir-group/fl…
nw13slx Feb 24, 2020
c65a90b
fix an import error in test_ase_setup/test_stress.py and a bug in nor…
nw13slx Feb 24, 2020
9337b50
merge with latest development branch
nw13slx Feb 24, 2020
0d15f81
add mb in the force_en unit test
nw13slx Feb 24, 2020
0c6c986
debug travis
nw13slx Feb 24, 2020
ebfdb39
debug travis
nw13slx Feb 24, 2020
8d9e20b
solve import error
nw13slx Feb 24, 2020
9e6094b
add many body in gp test
nw13slx Feb 24, 2020
6b767b7
travis debug
nw13slx Feb 24, 2020
221e64b
update env as_dict
nw13slx Feb 24, 2020
0823b49
trying to fix the env as dict bug.
nw13slx Feb 24, 2020
054c986
fix the env as dict bug.
nw13slx Feb 24, 2020
e063d35
fix conflict
nw13slx Feb 24, 2020
45417ed
remove wrong print lines
nw13slx Feb 24, 2020
e927ec0
fix glob import error
nw13slx Feb 24, 2020
3d5a8b9
revise test file to accomondate change of env cutoff
nw13slx Feb 24, 2020
94547df
fix conflict between the function name and variable name of all_ase_calc
nw13slx Feb 24, 2020
33f57d4
fix mc_mb_kernel bug
nw13slx Feb 24, 2020
0abf685
reverser all_ase_calc change
nw13slx Feb 24, 2020
e89665f
use absolute path for lmp so the fail in test_lmp does not affect oth…
nw13slx Feb 24, 2020
aa82d75
fix test environment error by shrinking the cutoffs
nw13slx Feb 24, 2020
23652de
fix folder remove errors
nw13slx Feb 24, 2020
245cd67
add tmp dir
YuuuXie Feb 24, 2020
5255b87
Merge branch 'development' into merge/mc_simple+development
YuuuXie Feb 24, 2020
9cd91c1
make function blend in the many body
nw13slx Feb 24, 2020
92440a5
change arguments
nw13slx Feb 24, 2020
2980f80
update gp assert
nw13slx Feb 24, 2020
ef0fddb
add strings
nw13slx Feb 24, 2020
d95d909
fix bugs and add unittest for mc_sephyps with many body kernels
nw13slx Feb 24, 2020
759d50e
Merge branch 'merge/mc_simple+development' of github.com:mir-group/fl…
nw13slx Feb 24, 2020
c3d3f9a
corrected many body cutoff in 2+3+many mc kernels
AldoGl Feb 25, 2020
dc940ee
improved many-body multispecies kernel tests
AldoGl Feb 25, 2020
a30fe6d
move the initialization statement up
nw13slx Feb 25, 2020
a83a2e7
Merge pull request #146 from mir-group/merge/mc_simple+development
nw13slx Feb 25, 2020
486fa11
enlarge the random structure
YuuuXie Feb 25, 2020
8ec9ad2
enlarge the cell
YuuuXie Feb 25, 2020
25739a3
Merge branch 'development' of github.com:mir-group/flare into develop…
YuuuXie Feb 25, 2020
6f7a7a7
merge master
YuuuXie Feb 27, 2020
d20dd91
merge master
YuuuXie Feb 27, 2020
e17e271
fix merge conflict
YuuuXie Feb 27, 2020
8550948
change back to small random struc
YuuuXie Feb 27, 2020
d7592aa
enhance ase otf
YuuuXie Mar 13, 2020
34b32ea
fix conflict with master
YuuuXie Mar 13, 2020
2d2deea
solve gp conflict
nw13slx Mar 13, 2020
10bf427
fix gp_algebra conflict
nw13slx Mar 13, 2020
4a5288f
remove tree in the travis setting
nw13slx Mar 13, 2020
dcf65f5
remove kernel kernel_grad from tutorials
nw13slx Mar 14, 2020
c7af617
split the helper functions and the sc kernel to two files
nw13slx Mar 14, 2020
578b2a5
revise the document
nw13slx Mar 14, 2020
3dbaba1
change kernels to sc
nw13slx Mar 14, 2020
ea03754
fix the import error
nw13slx Mar 14, 2020
c85ec0b
fix more import errors...
nw13slx Mar 14, 2020
13948d7
update otf parse with kernel_name
nw13slx Mar 14, 2020
4348073
add DeprecationWarning
nw13slx Mar 14, 2020
58f5cea
update ase logger and parse_ase_otf with kernel_name
nw13slx Mar 14, 2020
ee2bdfb
add n_cpus to mgp args & fix small bugs
YuuuXie Mar 14, 2020
ce4175d
fix syntax
YuuuXie Mar 14, 2020
1a43c44
GP can check L alpha with empty training set now
stevetorr Mar 15, 2020
1175dbc
remove the repeated mgp_en block. and formated a couple output lines …
nw13slx Mar 18, 2020
f8a4545
add notimplement error for update in mgp_en
nw13slx Mar 18, 2020
ee5ddac
load large kymat from external npy in from_file
nw13slx Mar 18, 2020
7725523
revise the runtimeerror to warning as stevetorr suggested.
nw13slx Mar 18, 2020
968aa78
Printed hyps are now easier to read, copy+paste
Mar 19, 2020
d818704
Fixed broken unit test, bug in serialization
Mar 19, 2020
4b31d49
Added safety catch to GP
stevetorr Mar 19, 2020
bc3e293
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Mar 19, 2020
f06abf5
Added from_file method to structure
stevetorr Mar 19, 2020
29309f0
Added more compatibility for from_file
stevetorr Mar 19, 2020
acb65c3
Fix minor bug in struc
stevetorr Mar 19, 2020
9bcb9ff
Improved output for GPFA and added GP statistics method
stevetorr Mar 21, 2020
801a6e5
Added GP statistics line to header of GPFA
stevetorr Mar 21, 2020
61e3f20
Improved printing of optional values in output.py
stevetorr Mar 21, 2020
b3fea04
Improve output
stevetorr Mar 21, 2020
655000f
Change n_cpu, validate_ratio, checkpoint_interval default behavior
stevetorr Mar 25, 2020
4690295
fix bug in printing info for partial optimization
nw13slx Mar 27, 2020
b357197
Added in_place args to predict functions
stevetorr Mar 27, 2020
d337c33
GPFA is now compatible with new predict functions
stevetorr Mar 27, 2020
b0ab348
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Mar 27, 2020
b45b21d
GPFA verbose 0 now writes no output but models
stevetorr Mar 27, 2020
c5d6e98
Update unit tests for MGP with GPFA
stevetorr Mar 27, 2020
b7a0764
Update re-reserialization method
stevetorr Mar 27, 2020
a08af57
Guess hyps used if none passed in
stevetorr Apr 1, 2020
7ec5e27
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 3, 2020
4bb95d8
Merge branch 'master' of github.com:mir-group/flare into development
nw13slx Apr 3, 2020
e80b5cf
fix self.par bug
nw13slx Apr 3, 2020
f6ff650
fix bug in predict.py
YuuuXie Apr 3, 2020
161e916
change gengrid_inner in update to point to global vairable
YuuuXie Apr 3, 2020
5c57316
fix unit test
YuuuXie Apr 4, 2020
1bdb50f
Removes wildcard exception for L-BFGS-B training
dmclark17 Apr 6, 2020
957ebde
Merge branch 'master' of github.com:mir-group/flare into development
nw13slx Apr 6, 2020
336558e
fix doc string and notes for parallelization
nw13slx Apr 6, 2020
3997404
Merge branch 'bug/david/training_exception' of github.com:mir-group/f…
nw13slx Apr 6, 2020
250c713
Vasp util can now parse stress-free structures
stevetorr Apr 7, 2020
68ba6e8
Small comment changes
stevetorr Apr 7, 2020
f0c399e
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Apr 7, 2020
86616ec
update doc string
nw13slx Apr 8, 2020
1ba0aca
let the bond array calculation block be a function member.
nw13slx Apr 8, 2020
b9b2bbe
fix bug; pass n_cpus and n_sample to Map3body instances
nw13slx Apr 8, 2020
3a30fe0
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 8, 2020
2029156
make mc as kernel default
nw13slx Apr 8, 2020
9b791cd
Added change_cutoffs method to GP
stevetorr Apr 9, 2020
b6a522f
add assert to ban gp instances using the same name
nw13slx Apr 9, 2020
ec82c7c
fix unit test bug
nw13slx Apr 9, 2020
b517b14
Fixed docstring on min_atoms_per_train
stevetorr Apr 10, 2020
61c58c0
add as/from_dict and write/load_model
YuuuXie Apr 12, 2020
6fbd71f
fix the clean function
YuuuXie Apr 12, 2020
fefc83c
sync global variable after loading from json file
nw13slx Apr 13, 2020
6e03861
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 13, 2020
22d423d
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr Apr 14, 2020
a247e61
Lots: GPFA now supports predict by species (tested), made small chang…
stevetorr Apr 14, 2020
d53840b
print number of environments in training set before pretrain
nw13slx Apr 15, 2020
24d0eed
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 15, 2020
61ff0e1
Correct a few typos
YuuuXie Apr 17, 2020
46daf27
remove print statements in mgp
nw13slx Apr 20, 2020
946f712
change np.zeros and np.ones argument to fix numba issue #101
nw13slx Apr 20, 2020
9d8dee5
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 20, 2020
fcee660
update dtype in test_gp
nw13slx Apr 20, 2020
1ca3bbf
Extremely minor changes to make mgp nicer
stevetorr Apr 21, 2020
fa0d286
Predict by atoms can now take selective atom input
stevetorr Apr 21, 2020
321c4f8
GPFA refactored to support parallelization by structure
stevetorr Apr 21, 2020
5592b4b
fix etype issue
nw13slx Apr 23, 2020
85365a7
update unit test
nw13slx Apr 23, 2020
c51ddf5
merge sc and mc unit test
nw13slx Apr 23, 2020
f6ce594
rename test
nw13slx Apr 23, 2020
79ae531
Future-proofed env for serialization
Apr 23, 2020
9d93c27
Merge branch 'development' of https://github.com/mir-group/flare into…
Apr 23, 2020
dce69f5
Future proofing deserialization
stevetorr Apr 23, 2020
d6bed89
refactor the test_gp following branch bug/david/training_exception
nw13slx Apr 23, 2020
adff7be
Merge branch 'development' of github.com:mir-group/flare into develop…
nw13slx Apr 23, 2020
27e8c4c
fix wrong cutoff in unittest for gp_from_aimd
nw13slx Apr 23, 2020
cdee021
fix another wrong argument
nw13slx Apr 25, 2020
7bdeb6d
change format
YuuuXie Apr 30, 2020
f907c9a
Merge pull request #166 from mir-group/bugfix/mb-etypes
nw13slx Apr 30, 2020
279b7e6
Fixed uncertainty printing
stevetorr May 5, 2020
d68f92a
Updated serialization methods
stevetorr May 5, 2020
d8b8e6e
Merge branch 'development' of https://github.com/mir-group/flare into…
stevetorr May 5, 2020
9c81b2c
Output skips nans
stevetorr May 5, 2020
d96de83
GPFA now allows finer control over writing
stevetorr May 12, 2020
22326b1
Clarify GP global memory ambiguity handling
stevetorr May 12, 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
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ tags
pwscf.save/
/docs/source/_build/html
/docs/build/
/docs/doctrees/
/datasets/
/tests/otf_data/
/tests/test_ase/out/
/tests/test_ase/Al/
/tests/test_ase/__pycache__/
Expand All @@ -30,6 +32,17 @@ test_files/qe_output_*.out
/tests/pwscf.xml
/tests/*-RESTART.kp*
/tests/*.wfn*
/tests/*.pwi*
/tests/*.pwo*
/tests/*-bak
/tests/cp2k.in*
/tests/*.in_run
/tests/tmp*
/tests/grid3*npy
/tests/AgI_Molten_15.txt
/tests/log.lammps
/tests/*.txt
/tests/*.mgp
/tests/*.log
/tests/POSCAR*
.idea/
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ cache:

before_install:
- sudo apt update
- sudo apt install -y quantum-espresso tree
- pip install codecov pytest pytest-cov
- sudo apt install -y quantum-espresso
- pip install codecov pytest pytest-cov pytest_mock
- pwd
- tree
- wget http://folk.uio.no/anjohan/lmp
- "wget https://github.com/cp2k/cp2k/releases/download/\
v6.1.0/cp2k-6.1-Linux-x86_64.sopt"
Expand All @@ -22,10 +21,10 @@ before_install:

script:
- pwd
- tree
- cd tests
- PWSCF_COMMAND=pw.x CP2K_COMMAND=../cp2k-6.1-Linux-x86_64.sopt lmp=../lmp
pytest --cov=../flare/
- PWSCF_COMMAND=pw.x CP2K_COMMAND=../cp2k-6.1-Linux-x86_64.sopt
lmp=$(pwd)/../lmp
pytest --show-capture=all -vv --durations=0 --cov=../flare/
- coverage xml

after_success:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/FAQs/all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gaussian Processes and OTF

* `maxiter`: maximal number of iterations, usually set to ~10 to prevent training for too long.

* `par`: if `True`, then parallelization is used in optimization.
* `parallel`: if `True`, then parallelization is used in optimization.
The serial version could be very slow.

* `output` (in `train` function): set up an output file for monitoring optimization iterations.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/flare/gp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gaussian Process Force Fields

struc
env
kernels/kernels
kernels/sc
kernels/mc_simple
kernels/mc_sephyps
cutoffs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Single-element Kernels
======================

.. automodule:: flare.kernels.kernels
.. automodule:: flare.kernels.sc
:members:
5 changes: 5 additions & 0 deletions docs/source/flare/kernels/util.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Kernel interface (for developer)
======================

.. automodule:: flare.kernels.utils
:members:
6 changes: 3 additions & 3 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Second, in the initialization of the GP class and OTF class, turn on the GP para

.. code-block:: python

gp_model = GaussianProcess(..., n_cpus=2)
otf_instance = OTF(..., par=False, n_cpus=2)
gp_model = GaussianProcess(..., parallel=True, per_atom_par=False, n_cpus=2)
otf_instance = OTF(..., par, n_cpus=2)

Third, set the number of threads for MKL before running your python script.

Expand All @@ -100,7 +100,7 @@ Third, set the number of threads for MKL before running your python script.
If these numbers are larger than the actual CPUs number, it can lead to an overload of the machine.

.. note::
If OTF.par=True and GaussianProcess.n_cpus>1, it is equivalent to run with n_cpu**2 threads
If gp_model.per_atom_par=True and NUM_OMB_THREAD>1, it is equivalent to run with NUM_OMB_THREAD*otf.n_cpus threads
because the MKL calls are nested in the multiprocessing code.

The current version of FLARE can only support parallel calculations within one compute node.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/tutorials/after_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# -------------------------------------------------------------------------
# reconstruct gp model from otf snippet
# -------------------------------------------------------------------------
import flare.kernels.mc_simple as mc_simple

kernel = mc_simple.two_plus_three_body_mc
kernel_grad = mc_simple.two_plus_three_body_mc_grad
gp_model = otf_object.make_gp(kernel=kernel, kernel_grad=kernel_grad,



gp_model = otf_object.make_gp(kernel_name="2+3_mc",
hyp_no=hyp_no)
gp_model.par = True
gp_model.parallel = True
gp_model.hyp_labels = ['sig2', 'ls2', 'sig3', 'ls3', 'noise']

# write model to a binary file
Expand Down
9 changes: 3 additions & 6 deletions docs/source/tutorials/gpfa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Step 1: Setting up a Gaussian Process Object
Our goal is to train a GP, which first must be instantiated with a set of parameters.

For the sake of this example, which is a molecule, we will use a two-plus-three body kernel.
We must provide the kernel and the kernel gradient as ``callable`` s to the GP.
We must provide the kernel name to the GP, "two-plus-three-mc" or "2+3mc'.
Our initial guesses for the hyperparameters are not important.
The hyperparameter labels are included below for later output.
The system contains a small number of atoms, so we choose a relatively
Expand All @@ -30,7 +30,6 @@ At the header of a file, include the following imports:
.. code-block:: python

from flare.gp import GaussianProcess
from flare.kernels.mc_simple import two_plus_three_body_mc, two_plus_three_body_mc_grad

We will then set up the ``GaussianProcess`` object.

Expand All @@ -47,17 +46,15 @@ We will then set up the ``GaussianProcess`` object.
* | The two cutoff values correspond to the functions which set up
| the two- and three-body Atomic Environments. Since Methanol is a small
| molecule, 7 Angstrom each will be sufficent.
* | The kernels which facilitate these comparisons must be imported as Python ``callable`` s.
* | The kernel name must contain the terms you want to use.
* | Here, we will use the ``two_plus_three_body_mc`` kernel, which
| uses two-body and three-body comparisons. ``mc`` means multi-component,
| indicating that it can handle multiple atomic species being present.
* | We must also import the gradient of the kernel, which is
| ``two_plus_three_body_mc_grad``.


.. code-block:: python

gp = GaussianProcess(kernel=two_plus_three_body_mc, kernel_grad=two_plus_three_body_mc_grad,
gp = GaussianProcess(kernel_name="2+3mc",
hyps=[0.01, 0.01, 0.01, 0.01, 0.01],
cutoffs = (7,7),
hyp_labels=['Two-Body Signal Variance','Two-Body Length Scale','Three-Body Signal Variance',
Expand Down
23 changes: 4 additions & 19 deletions docs/source/tutorials/otf_al.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,35 @@ Step 1: Set up a GP Model
-------------------------

Let's start up with the GP model with three-body kernel function.
(See :doc:`kernels.py <../flare/kernels/kernels>` (single component)
(See :doc:`kernels.py <../flare/kernels/sc>` (single component)
or :doc:`mc_simple.py <../flare/kernels/mc_simple>` (multi-component) for more options.)

.. code-block:: python
:linenos:

# make gp model
kernel = en.three_body
kernel_grad = en.three_body_grad
hyps = np.array([0.1, 1, 0.01])
hyp_labels = ['Signal Std', 'Length Scale', 'Noise Std']
cutoffs = np.array([3.9, 3.9])
energy_force_kernel = en.three_body_force_en

gp = \
GaussianProcess(kernel=kernel,
kernel_grad=kernel_grad,
GaussianProcess(kernel_name='3b',
hyps=hyps,
cutoffs=cutoffs,
hyp_labels=hyp_labels,
energy_force_kernel=energy_force_kernel,
maxiter=50)


**Some Explanation about the parameters:**

* ``kernel``: set to be the kernel function
* ``kernel_name``: set to be the name of kernel functions

* import from :doc:`kernels.py <../flare/kernels/kernels>` (single-component system)
* import from :doc:`sc.py <../flare/kernels/sc>` (single-component system)
or :doc:`mc_simple.py <../flare/kernels/mc_simple>` (multi-component system).
* Currently we have the choices of two-body, three-body and two-plus-three-body kernel functions.
* Two-plus-three-body kernel function is simply the summation of two-body and three-body kernels,
and is tested to have best performance.

* ``kernel_grad``: set to be the gradient of kernel function used for hyperparameter training.

* ``hyps``: the array of hyperparameters, whose names are shown in ``hyp_labels``.

* For two-body kernel function, an array of length 3 is needed, ``hyps=[sigma_2, ls_2, sigma_n]``;
Expand All @@ -53,21 +46,13 @@ or :doc:`mc_simple.py <../flare/kernels/mc_simple>` (multi-component) for more o
* ``cutoffs``: consists of two values. The 1st is the cutoff of two-body and the 2nd is for three-body kernel.
Usually we will set a larger one for two-body.

* ``energy_force_kernel``: set to calculate local energy for each atom based on the integral of forces.

* ``maxiter``: set to constrain the number of steps in training hyperparameters.


**Note:**

1. See :doc:`GaussianProcess <../flare/gp>` for complete description of arguments of ``GaussianProcess`` class.

2. In any case, you need to set up ``kernel``.

a. If you want to train the hyperparameters, you need to set up ``kernel_grad``;
b. If you want the output of local energy, you need to set up ``energy_force_kernel`` and ``energy_kernel``,
otherwise you don't need them.


Step 2: Set up DFT Calculator
-----------------------------
Expand Down
34 changes: 15 additions & 19 deletions flare/ase/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def get_property(self, name, atoms=None, allow_calculation=True):


def get_potential_energy(self, atoms=None, force_consistent=False):
if self.use_mapping:
print('MGP energy mapping not implemented, temporarily set to 0')
return self.get_property('energy', atoms)


Expand Down Expand Up @@ -99,32 +97,30 @@ def calculate_mgp_serial(self, atoms):
atoms.get_atomic_numbers(),
atoms.positions)

forces = np.zeros((nat, 3))
stress = np.zeros((nat, 6))
stds = np.zeros((nat, 3))
self.results['forces'] = np.zeros((nat, 3))
self.results['stresses'] = np.zeros((nat, 6))
self.results['stds'] = np.zeros((nat, 3))
self.results['local_energies'] = np.zeros(nat)
for n in range(nat):
chemenv = AtomicEnvironment(struc_curr, n,
self.mgp_model.cutoffs)
f, v, vir = self.mgp_model.predict(chemenv, mean_only=False)
forces[n] = f
stress[n] = vir
stds[n] = np.sqrt(np.absolute(v))
f, v, vir, e = self.mgp_model.predict(chemenv, mean_only=False)
self.results['forces'][n] = f
self.results['stresses'][n] = vir
self.results['stds'][n] = np.sqrt(np.absolute(v))
self.results['local_energies'][n] = e

self.results['forces'] = forces
self.results['stds'] = stds
self.results['stresses'] = stress
self.results['stress'] = np.sum(stress, axis=0)

# TODO: implement energy mapping
self.results['local_energies'] = np.zeros(forces.shape)
self.results['energy'] = 0
volume = atoms.get_volume()
total_stress = np.sum(self.results['stresses'], axis=0)
self.results['stress'] = total_stress / volume
self.results['energy'] = np.sum(self.results['local_energies'])

atoms.get_uncertainties = self.get_uncertainties
return forces


def calculate_mgp_par(self, atoms):
return self.calculate_mgp_serial(atoms)
# TODO: to be done
self.calculate_mgp_serial(atoms)


def calculation_required(self, atoms, quantities):
Expand Down
Loading