forked from openkim/kliff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
210 lines (175 loc) · 10.6 KB
/
TODO
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
202
203
204
205
206
207
208
209
210
0. nomenclature
optimizable: the model params that can be optimized (the FREE_PARAMS_)
optimizing: a subset of optimizable params. The params that are selected to be
optimized.
optimized: the output params by the fitting program after training.
Not yet: task not finished yet.
Done: task finished.
N/A: task not applicable any more.
1. 09/18/2016:
KIM_API_get_rank and KIM_API_get_shape should be used to inquire KIM about
the available potential model parameters. Done
Influence distance read in from input file should be supported. Done
The return data should be changed to numpy array as many as possible and
should return a copy not directly the mutable array wherever possible. Not yet
Avoid the use of "for" loops as much as possible. Use numpy matrix operation.
2. 10/03/2016:
Set cutoff before building neighborlist in kimcalculator. Done
Update 10/11/2016
The KIM philosophy is that you should not modify the 'cutoff' stored in
the KIM object directly, but change it through 'FREE_PARAM_...'. This
makes sense since in most KIM models, the 'cutsq' is determined in the
Model init subroutine, and stored in a buffer. Later, this buffered value
will be used in model compute. Then if you change the cutoff directly in
the KIM object, this will not be updated. The correct way is that the
fitting program change it through 'FREE_PARAM_', and then call model_reinit
routine (where, the cutoff in KIM object will be updated from FREE_PARAM_cutoff).
Note, both cutoff and FREE_PARAM_cutoff are stored in KIM object, but
their role is totally different. As said, FREE_PARAM_cutoff is only used
for publish parameters, however, cutoff is used by model compute function,
and a simulator can query it to set up the neighborlist.
So, we should definitely not get our hands dirty on changing the cutoff
directly. So remove the above settings. Done
3.10/10/2016:
Include a standard OpenKIM test to ensure that the edn parsing works. N/A
4.10/12/2016:
A helper function (may be placed in utils) is needed to check the input
(or parsed value) dimensions. Whether they are collections.Sequence?
np.ndarray (then what's the dimension)? Possibly make changes to them
(to 1D array is an option). Not yet
In all calculators, call update_params in get_prediction. and remove
explicit call from traincost. Done
5. 10/19/2016:
In modelparams.py, the format set_params() should be changed. Instead
of using list, its more natural to use dictionary with the parameter name
as the key. i.e. instead of using
param_A = ['PARAM_FREE_A',
['kim', 0, 20],
[2.0, 'fix'],
[2.2, 1.1, 3.3]
]
using
param_A = {'PARAM_FREE_A':[ ['kim', 0, 20],
[2.0, 'fix'],
[2.2, 1.1, 3.3]] }
6. 10/30/2016:
In traincost.py, use numpy.array_split to partition pred etc into groups,
instead of in-house code. Done
7. 12/22/2016:
fisher.py can be parallelized in the same way as cost. Not yet
Seems not the same, since to compute the derivative, each configuration
need to change the parameters. But we have only one ModelParams object.
To do this, we need the same number of ModelParams objects as nprocs.
8. 01/04/2017:
Add constraint to parameters. For example, Param_A = 3+Param_B. This
requires modification of modelparams.py. For param input, add keywords
'constraint', and use python builtin eval() to process the constraint.
NOTE, some minimizer can also do constrained optimization to require that
the parameters be within a range. So we should consider how to distinguish
these two. One way is that the constrained params will not be used as
optimizing params, but just a way for model to do computations. Then, for
this type of constraint, only "A=func(B,C)" is allowed, but "A>func(B,C)"
is not. N/A
9. 02/08/2017:
Add a flag to normalize the forces (energy etc) by the reference values
when computing the cost. N/A
10. 02/08/2017:
In the force calculator, create an argument `weight_energy = None', then
check it within the code, if it is not None, add the energy to the cost. Done
Note the above way is impossible. Since weight is used in Cost class,
while energy and forces are computed in KIMcalculator.
Instead, we have implemented a bool `use_energy' to pass to KIMcalculator.
This requires the energy ref value and weight value should be passed as
the first value (before those of forces.) This needs a bit care.
11. 03/09/2017:
Call initialize() in __init__() for in KIMcalculator, then the user does
not need to call it explicitly. Done
12. 08/03/2017:
np.reshape can be used as np.reshape(array, (-1:3)), where the dimension
of -1 is inferred. Check and do the replacement. Done
13. 08/23/2017:
Change class TrainingSet to Dataset. It can contain validation, test
data as well. Done
14. 08/02/2018: Not yet
For ANN, add check for species that are present in training set also given
in descriptor.
15. 02/06/2019: Done
Rename the ComputeArguments class as Model, and move the definition of
parameters into it. So if one wants to define a new model, he only needs
to subclass this class, and there is no need to create the Calculator
class.
For the KIM model, it only needs to deal with parameters. Maybe, transform
the FittingParameter class into a KIM model class.
Also, it seems possible to combine the `model_params` of a calculator,
and the `fitting_params` of a calculator, by adding a 'fitting' attribute
to `model_params`.
16. 03/23/2019:
Add test to kliff command line tools. Not yet
17. 07/15/2019:
GPU support for NN models.
Not yet
18. 07/15/2019:
Rewrite the C++ implementation of the descriptors such that it can be used
directly by the KIM driver. Add a function ``read_parameters'' for each
descriptor to process parameter files (needed to KIM driver).
Done for symmetry functions
19. 07/15/2019:
Support the geodesic LM optimizer by Mark.
Done
20. 07/15/2019:
Extend to support more descriptors (e.g. many-body tensor and SOAP) and more
machine learning regression methods (e.g. Kernel ridge regression and
Gaussian process.)
Not yet
21. 07/15/2019:
Extend to support more analyzers, such as RMSE of energy and forces.
Done
22. 07/15/2019:
Models like EAM have a large number of parameters. It is not a good idea to
ask the user to specify the initial guesses of them one by one. Maybe provide
an interface to enable the use of default values for all parameters.
In practice, people typically fit EAM only use tens of spline knots (at least
Baskes did so), so we may want to create a parameter file with fewer spline
knots. One way to do this could be: (1) inquire the original model to get all
spline knots; (2) select a subset of the knots and create a new model; and
(3) fitting use the new model with smaller number of knots. In such, the
initial guesses should be reasonable.
Not yet
23. 07/15/2019:
Use KIM tests to compute properties (e.g. equilibrium lattice constant and
elastic constants) as the predictions of a model. In such, we can fit to
other properties in addition to the currently supported energy, forces, and
stresses. As a prerequisite, KIM tests need to be updated to provide an
interface to change model parameters and stay alive during the fitting.
Not yet
24. 07/15/2019:
Allow passing `mean_and_std_path` to method `create` of torch calculators.
Then, avoid differentiating training set and test set. This is needed by
analyzers, where one cannot distinguish training and testing set.
Done
25. 07/25/2019:
Two models can be regarded as one in the sense that the combination of them
give the total energy, forces ... The Purpose of wrapcalcualtor.py was to
support the fitting of two models together. The code (wrapcalcualtor.py itself
and loss.py) is out of data. Need to be updated. Otherwise, we need to clean
up loss.py to remove the support for it.
Not yet
26. 08/15/2019:
For torch models, to fully resume training from a checkout, it is not enough
to save and load state_dict() of model parameters only. We also need to set
save and load the sate_dict() of the optimizer (not done yet).
See for example: https://discuss.pytorch.org/t/restoring-optimizer-and-model-from-saved-state-not-fully-reproducing-training-results/9463
Two problems:
(1) The optimizer is hidden from the user, then how to load? A possible
solution is when calling the load function we do not actually load the
optimizer, but just keep a record of the path. Then load it later.
(2) Can be combined save model and save optimizer as one function call and
where to put it.
Done
27. 08/18/2019:
Update analyzer/fisher.py to be consistent with the latest calculator.
Done
27. 08/23/2019:
Check whether a KIM model is installed in __init__() of kim.py using the newly
added collections management tool of kimpy.
Not yet