Commit 9b1df92
authored
feat(pt/dp): add cosine LR & BaseLR (#5142)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a cosine-annealing learning-rate schedule alongside the existing
exponential option.
* **Configuration**
* Training can now select between exponential and cosine schedules;
selection and error handling improved.
* Both variants are exposed via the argument-registration system for
configuration.
* **Tests**
* Added unit tests validating the cosine curve (start, end, midpoint,
and steady final value).
* **Refactor**
* Introduced a common learning-rate schedule base and refactored the
exponential schedule to use it.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 8f021aa commit 9b1df92
File tree
5 files changed
+133
-11
lines changed- deepmd
- dpmodel/utils
- pt
- train
- utils
- utils
- source/tests/pt
5 files changed
+133
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
7 | 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 | + | |
8 | 51 | | |
9 | | - | |
| 52 | + | |
| 53 | + | |
10 | 54 | | |
11 | 55 | | |
12 | 56 | | |
| |||
37 | 81 | | |
38 | 82 | | |
39 | 83 | | |
40 | | - | |
| 84 | + | |
41 | 85 | | |
42 | 86 | | |
43 | 87 | | |
| |||
47 | 91 | | |
48 | 92 | | |
49 | 93 | | |
50 | | - | |
| 94 | + | |
51 | 95 | | |
52 | 96 | | |
53 | 97 | | |
54 | 98 | | |
55 | 99 | | |
56 | 100 | | |
57 | 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 269 | + | |
273 | 270 | | |
274 | | - | |
275 | | - | |
| 271 | + | |
| 272 | + | |
276 | 273 | | |
277 | 274 | | |
278 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2477 | 2477 | | |
2478 | 2478 | | |
2479 | 2479 | | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
2480 | 2484 | | |
2481 | 2485 | | |
2482 | 2486 | | |
| |||
2509 | 2513 | | |
2510 | 2514 | | |
2511 | 2515 | | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
2512 | 2534 | | |
2513 | 2535 | | |
2514 | 2536 | | |
2515 | 2537 | | |
2516 | 2538 | | |
2517 | | - | |
| 2539 | + | |
2518 | 2540 | | |
2519 | 2541 | | |
2520 | 2542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
105 | 122 | | |
106 | 123 | | |
0 commit comments