gradboard 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gradboard might be problematic. Click here for more details.
- gradboard/cycles.py +1 -9
- gradboard/scheduler.py +14 -10
- {gradboard-0.1.13.dist-info → gradboard-0.1.15.dist-info}/METADATA +1 -1
- gradboard-0.1.15.dist-info/RECORD +8 -0
- gradboard-0.1.13.dist-info/RECORD +0 -8
- {gradboard-0.1.13.dist-info → gradboard-0.1.15.dist-info}/LICENSE +0 -0
- {gradboard-0.1.13.dist-info → gradboard-0.1.15.dist-info}/WHEEL +0 -0
gradboard/cycles.py
CHANGED
|
@@ -37,7 +37,7 @@ def cosine(step: int, total_steps: int) -> float:
|
|
|
37
37
|
return round((math.cos(angle) + 1) / 2, 8)
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
def
|
|
40
|
+
def quarter_circle(step: int, total_steps: int) -> float:
|
|
41
41
|
"""
|
|
42
42
|
Get a sequence of numbers between 0 and 1 in the shape of a semi-circle with
|
|
43
43
|
diameter `total_steps'.
|
|
@@ -51,14 +51,6 @@ def semicircle(step: int, total_steps: int) -> float:
|
|
|
51
51
|
return math.sqrt(y_squared)
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
def half_semicircle(step: int, total_steps: int) -> float:
|
|
55
|
-
"""
|
|
56
|
-
Get a sequence of numbers between 0 and 1 in the shape of the descending
|
|
57
|
-
half of a cosine wave with wavelength 2*`total_steps`.
|
|
58
|
-
"""
|
|
59
|
-
return semicircle(step, (total_steps * 2) - 1)
|
|
60
|
-
|
|
61
|
-
|
|
62
54
|
def half_cosine(step: int, total_steps: int) -> float:
|
|
63
55
|
"""
|
|
64
56
|
Get a sequence of numbers between 0 and 1 in the shape of the descending
|
gradboard/scheduler.py
CHANGED
|
@@ -7,6 +7,7 @@ import copy
|
|
|
7
7
|
import math
|
|
8
8
|
|
|
9
9
|
from scipy.ndimage import gaussian_filter1d
|
|
10
|
+
import scipy.constants as sc
|
|
10
11
|
|
|
11
12
|
from torch.amp import GradScaler
|
|
12
13
|
|
|
@@ -159,16 +160,19 @@ class PASS:
|
|
|
159
160
|
"""
|
|
160
161
|
range_test_results = self._smoothed_range_test(self.range_test_results)
|
|
161
162
|
minimum = min(range_test_results, key=lambda x: x[1])
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
for
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
self.max_lr = minimum[0] / sc.golden
|
|
164
|
+
self.cool_point = self.max_lr / 100
|
|
165
|
+
# self.cool_point = r[0] / 3
|
|
166
|
+
# points_left_of_min = [p for p in range_test_results if p[0] < minimum[0]]
|
|
167
|
+
# highest_point_left_of_min = max(points_left_of_min, key=lambda x: x[1])
|
|
168
|
+
# halfway = (highest_point_left_of_min[1] + minimum[1]) / 2
|
|
169
|
+
# for r in range_test_results:
|
|
170
|
+
# if r[1] < halfway:
|
|
171
|
+
# self.max_lr = r[0] * 3
|
|
172
|
+
# self.cool_point = r[0] / 3
|
|
173
|
+
# print("High LR", self.max_lr)
|
|
174
|
+
# print("Cool point", self.cool_point)
|
|
175
|
+
# break
|
|
172
176
|
|
|
173
177
|
def update_learning_rates(self):
|
|
174
178
|
if self.finished:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
+
gradboard/cycles.py,sha256=ZPXBL8rlaP6BYJ6Un2xRERsdifixSoVIZWaJMck4bjE,9945
|
|
3
|
+
gradboard/optimiser.py,sha256=Iw1piQkQkWdNUW8d9f3iPrvP9qEGVxEKmerK7ATDgOI,6189
|
|
4
|
+
gradboard/scheduler.py,sha256=VhP11bphPHTbTiFlesQFQEUMWNiY282zgdN45NKmLdY,6682
|
|
5
|
+
gradboard-0.1.15.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
+
gradboard-0.1.15.dist-info/METADATA,sha256=19BGUsfjrFfhLMeDsSCMohQ8uIYpS5cpJTKjAQK7CkE,2174
|
|
7
|
+
gradboard-0.1.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
+
gradboard-0.1.15.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
-
gradboard/cycles.py,sha256=WFEkmNxRxayzpnM7PmhcYDjoakXKLT1bcLS0dKERIDA,10209
|
|
3
|
-
gradboard/optimiser.py,sha256=Iw1piQkQkWdNUW8d9f3iPrvP9qEGVxEKmerK7ATDgOI,6189
|
|
4
|
-
gradboard/scheduler.py,sha256=W146MgdTYz113R3M0qhVpk8kr6L1ioPS3pCFc3MhKYg,6507
|
|
5
|
-
gradboard-0.1.13.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
-
gradboard-0.1.13.dist-info/METADATA,sha256=5f4aMHtVscTV8SdyvABKgbXNtmwrGm10kOu5XhXSN9U,2174
|
|
7
|
-
gradboard-0.1.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
-
gradboard-0.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|