gradboard 3.0.0__py3-none-any.whl → 3.0.1__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/scheduler.py +9 -9
- {gradboard-3.0.0.dist-info → gradboard-3.0.1.dist-info}/METADATA +1 -1
- gradboard-3.0.1.dist-info/RECORD +8 -0
- gradboard-3.0.0.dist-info/RECORD +0 -8
- {gradboard-3.0.0.dist-info → gradboard-3.0.1.dist-info}/LICENSE +0 -0
- {gradboard-3.0.0.dist-info → gradboard-3.0.1.dist-info}/WHEEL +0 -0
gradboard/scheduler.py
CHANGED
|
@@ -25,11 +25,12 @@ class PASS:
|
|
|
25
25
|
optimiser,
|
|
26
26
|
scaler: Optional[GradScaler] = None,
|
|
27
27
|
range_test: bool = False,
|
|
28
|
-
max_lr: float = None,
|
|
29
28
|
cool_point_multiplier: float = 1 / 60,
|
|
30
29
|
):
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
"""
|
|
31
|
+
If not using range test, we assume the optimiser has the learning rates
|
|
32
|
+
set as desired.
|
|
33
|
+
"""
|
|
33
34
|
|
|
34
35
|
self.model = model
|
|
35
36
|
self.optimiser = optimiser
|
|
@@ -41,7 +42,6 @@ class PASS:
|
|
|
41
42
|
|
|
42
43
|
self.original_param_groups = copy.deepcopy(optimiser.param_groups)
|
|
43
44
|
|
|
44
|
-
self.max_lr = max_lr
|
|
45
45
|
self.cool_point_multiplier = cool_point_multiplier
|
|
46
46
|
|
|
47
47
|
self.original_states = self._saved_states()
|
|
@@ -160,15 +160,15 @@ class PASS:
|
|
|
160
160
|
points_left_of_min = [r for r in range_test_results if r[0] < minimum[0]]
|
|
161
161
|
max_left_of_min = max(points_left_of_min, key=lambda x: x[1])
|
|
162
162
|
difference = max_left_of_min[1] - minimum[1]
|
|
163
|
-
|
|
163
|
+
max_lr = None
|
|
164
164
|
for p in sorted(points_left_of_min, key=lambda x: x[0]):
|
|
165
|
-
if (
|
|
166
|
-
|
|
165
|
+
if (max_lr is None) and (p[1] < minimum[1] + 0.2 * difference):
|
|
166
|
+
max_lr = p[0]
|
|
167
167
|
else:
|
|
168
168
|
continue
|
|
169
|
-
self.set_all_lr(
|
|
169
|
+
self.set_all_lr(max_lr)
|
|
170
170
|
self.original_param_groups = copy.deepcopy(self.optimiser.param_groups)
|
|
171
|
-
print("High LR",
|
|
171
|
+
print("High LR", max_lr)
|
|
172
172
|
|
|
173
173
|
def update_learning_rates(self):
|
|
174
174
|
if not self.finished:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
+
gradboard/cycles.py,sha256=iGEW3Rlp-JNyQZLfpaDXxUCAcEV01ANjLF-Fnhug-qA,10120
|
|
3
|
+
gradboard/optimiser.py,sha256=Br7MNiziiwQZhq6UWkBy1zndRuDFznNfrE91usguZHI,6168
|
|
4
|
+
gradboard/scheduler.py,sha256=QpgB-jk16Srghu3J8aLKlIuOEG4Y3Ho6pXiAyD7VUQw,6968
|
|
5
|
+
gradboard-3.0.1.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
+
gradboard-3.0.1.dist-info/METADATA,sha256=AIkMJI_o3iJXLUnpHbl8FqtvT9DNatLnFBdWxzeuPjY,2173
|
|
7
|
+
gradboard-3.0.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
+
gradboard-3.0.1.dist-info/RECORD,,
|
gradboard-3.0.0.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
-
gradboard/cycles.py,sha256=iGEW3Rlp-JNyQZLfpaDXxUCAcEV01ANjLF-Fnhug-qA,10120
|
|
3
|
-
gradboard/optimiser.py,sha256=Br7MNiziiwQZhq6UWkBy1zndRuDFznNfrE91usguZHI,6168
|
|
4
|
-
gradboard/scheduler.py,sha256=sELx3LdbF_ZiD3HDtxOPIR3xLJHD1Vv7IXgJGYuYdJM,6985
|
|
5
|
-
gradboard-3.0.0.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
-
gradboard-3.0.0.dist-info/METADATA,sha256=YazOjmOo5Fot5xtGvQSyH600yKfUGsvr0j8NKFkZu0U,2173
|
|
7
|
-
gradboard-3.0.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
-
gradboard-3.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|