Commit f9f1759
Refactor property fitting interface (#4471)
Two main changes:
1. The program can read data files in `npy` format with any
prefix(`tc.npy`, `band_gap.npy`...). One just needs to write the name of
the property and the corresponding dimension in `model/fitting` in
`input.json`.
2. Data normalisation has been added to the program. Specifically, the
mean and standard deviation of the properties are calculated when
calculating the stat, the output of `fitting_net` is multiplied by the
standard deviation and then added to the mean to get the output of the
`PropertyModel`, and when calculating the loss, the loss is again
normalised.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
- **New Features**
- Introduced new parameters for property loss calculations and model
fitting, enhancing flexibility and functionality.
- Added methods for retrieving property names and checking property
intensity across various classes.
- **Bug Fixes**
- Improved validation and error handling for property-related
calculations.
- **Documentation**
- Enhanced documentation for property fitting, including detailed
parameter explanations and structured training examples.
- Added documentation for new parameters in the JSON configuration
related to property fitting.
- **Tests**
- Added new test cases to validate the functionality of updated methods
and properties.
- Updated existing tests to utilize dynamic property names instead of
hardcoded strings.
- **Chores**
- Updated configuration files and test data to align with new property
handling features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Chenqqian Zhang <100290172+Chengqian-Zhang@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent f8605ee commit f9f1759
File tree
43 files changed
+652
-146
lines changed- deepmd
- dpmodel
- atomic_model
- fitting
- model
- entrypoints
- infer
- pt
- infer
- loss
- model
- atomic_model
- model
- task
- train
- utils
- utils
- doc/model
- examples/property
- data
- data_0/set.000000
- data_1/set.000000
- data_2/set.000000
- train
- source/tests
- common
- consistent
- fitting
- model
- pd/model
- pt
- model
- property
- double
- set.000000
- single/set.000000
- universal
- common/cases/model
- dpmodel
- fitting
- loss
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
43 files changed
+652
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
| 76 | + | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | 91 | | |
94 | | - | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
116 | | - | |
| 114 | + | |
117 | 115 | | |
118 | | - | |
| 116 | + | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
| |||
131 | 129 | | |
132 | 130 | | |
133 | 131 | | |
| 132 | + | |
134 | 133 | | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
783 | 785 | | |
784 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
785 | 793 | | |
786 | 794 | | |
787 | 795 | | |
| |||
832 | 840 | | |
833 | 841 | | |
834 | 842 | | |
835 | | - | |
| 843 | + | |
836 | 844 | | |
837 | 845 | | |
838 | 846 | | |
839 | 847 | | |
840 | | - | |
| 848 | + | |
841 | 849 | | |
842 | 850 | | |
843 | 851 | | |
| |||
854 | 862 | | |
855 | 863 | | |
856 | 864 | | |
857 | | - | |
| 865 | + | |
858 | 866 | | |
859 | 867 | | |
860 | 868 | | |
| |||
868 | 876 | | |
869 | 877 | | |
870 | 878 | | |
871 | | - | |
| 879 | + | |
872 | 880 | | |
873 | 881 | | |
874 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
276 | 274 | | |
277 | 275 | | |
278 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
47 | | - | |
48 | | - | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
| 63 | + | |
51 | 64 | | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
| |||
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
123 | | - | |
| 139 | + | |
124 | 140 | | |
125 | 141 | | |
126 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
127 | 145 | | |
128 | 146 | | |
129 | 147 | | |
| |||
141 | 159 | | |
142 | 160 | | |
143 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
144 | 166 | | |
145 | 167 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
187 | 196 | | |
188 | 197 | | |
189 | 198 | | |
| |||
200 | 209 | | |
201 | 210 | | |
202 | 211 | | |
203 | | - | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
0 commit comments