forked from MDIL-SNU/SIMPLE-NN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
201 lines (184 loc) · 7.23 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
###########################################################
# Introduction #
###########################################################
SIMPLE-NN(SNU Interatomic Machine Learning Potential -
version Neural Network)
The package for generating interatomic potentials using
###########################################################
# File description #
###########################################################
Overall list of files in SIMPLE-NN is described below:
-----------------------------------------------------------
setup.py
README
simple_nn/
_version.py
__init__.py
features/
__init__.py
symmetry_function/
__init__.py
symmetry_functions.cpp
symmetry_functions.h
calculate_sf.cpp
calculate_sf.h
pair_nn.cpp
pair_nn.h
models/
__init__.py
neural_network.py
utils/
__init__.py
lbfgs.py
graph.py
gdf.cpp
examples/
SiO2/
OUTCAR_comp
run.py
input.yaml
params_Si
params_O
str_list
-----------------------------------------------------------
Brief description of each file:
- setup.py: Setup file for install SIMPLE-NN
- README:
This file. Brief description of code, Installation
method, Usage and the description of examples are
contained.
- simple_nn/
- features/:
Part for calculating descriptor vectors(or features)
from quantum mechanics calculation data.
- symmetry_function/:
Class for calculating symmetry function vectors and
preprocessing the calculated values
- __init__.py: Main code for this part
- symmetry_functions.*, calculate_sf.*:
C++ implementation for calculating symmetry function
- pair_nn.*: LAMMPS implementation
- models/:
- neural_network.py:
Class for handling neural network model and optimizing
the weight parameters in the network.
- utils/:
- __init__.py: Set of utility functions
- lbfgs.py: L-BFGS implementation
- graph.py: Set of graph-related functions
- gdf.cpp: GDF implementation
- examples/SiO2:
Folder contains MD trajectory data for bulk SiO2 and
corresponding input files, running script
###########################################################
# Installation #
###########################################################
SIMPLE-NN use some python libraries. Among them,
2 libraries (Tensorflow and mpi4py(optional)) are required
before install SIMPLE-NN.
Other modules that are used in SIMPLE-NN is automatically
installed during the installation process of SIMPLE-NN.
- install Tensorflow: https://www.tensorflow.org/install/
- install mpi4py(using pip):
-----------------------------------------------------------
$ pip install mpi4py
-----------------------------------------------------------
- Basic installation of SIMPLE-NN
-----------------------------------------------------------
$ python setup.py
-----------------------------------------------------------
- LAMMPS implementation
Currently, symmetry_function - neural_network model is
implemented in LAMMPS. To use LAMMPS implementation,
Copy the source code to LAMMPS src directory.
-----------------------------------------------------------
$ cp /directory/of/simple-nn/features/symmetry_function/
pair_nn.* /directory/of/lammps/src/
$ cp /directory/of/simple-nn/features/symmetry_function/
symmetry_function.* /directory/of/lammps/src/
-----------------------------------------------------------
And compile LAMMPS code.
###########################################################
# Usage #
###########################################################
To use SIMPLE-NN, 3 types of files (input.yaml, params_XX,
str_list) are required.
======================= input.yaml ========================
Parameter list to control SIMPLE-NN code is listed in
input.yaml. Full parameter list can be found at our online
manual(http://mtcg.snu.ac.kr/doc/index.html).
The simplest form of input.yaml is described below:
-----------------------------------------------------------
generate_features: true
preprocess: true
train_model: true
atom_types:
- Si
- O
symmetry_function:
params:
Si: params_Si
O: params_O
neural_network:
method: Adam
nodes: 30-30
-----------------------------------------------------------
======================== params_XX ========================
params_XX (XX means atom type that is included your target
system) indicates the coefficients of symmetry functions.
Each line contains coefficients for one symmetry function.
detailed format is described below:
-----------------------------------------------------------
2 1 0 6.0 0.003214 0.0 0.0
2 1 0 6.0 0.035711 0.0 0.0
4 1 1 6.0 0.000357 1.0 -1.0
4 1 1 6.0 0.028569 1.0 -1.0
4 1 1 6.0 0.089277 1.0 -1.0
-----------------------------------------------------------
First one indicates the type of symmetry function.
Currently G2, G4 and G5 is available.
Second and third indicates the type index of neighbor
atoms which starts from 1. For radial symmetry function,
1 neighbor atom is need to calculate the symmetry function
value. Thus, third parameter is set to zero. For angular
symmtery function, 2 neighbor atom is needed. The order
of second and third do not affect to the calculation
result.
Fourth one means the cutoff radius for cutoff function.
The remaining parameters are the coefficients applied to
each symmetry function.
======================== str_list =========================
str_list contains the location of reference calculation
data. The format is described below:
-----------------------------------------------------------
/location/of/data/oneshot_output_file :
/location/of/data/MDtrajectory_output_file 100:2000:20
/location/of/data/same_name{1..10}/oneshot_output_file :
-----------------------------------------------------------
After indicating the file location, one need to indicate
the snapshot index for calculating features. The format is
'start:end:interval'. ':' means all snapshot, '::interval'
means extract snapshot with the interval from entire
trajectory.
============= Script for running SIMPLE-NN ================
After preparing input.yaml, params_XX and str_list, one can
run SIMPLE-NN using the script below:
-----------------------------------------------------------
# run.py
# Usage: $ Python run.py
from simple_nn import Simple_nn
from simple_nn.features.symmetry_function import Symmetry_function
from simple_nn.models.neural_network import Neural_network
model = Simple_nn('input.yaml',
descriptor=Symmetry_function(),
model=Neural_network())
model.run()
-----------------------------------------------------------
###########################################################
# Example #
###########################################################
In examples folder, one can find MD trajectories of bulk
SiO2, corresponding input files (input.yaml, params_Si,
params_O and str_list) and python script run.py. To use
this example, one simply change the location in the
'str_list' file and run 'Python run.py' command.