gradboard 0.1.9__py3-none-any.whl → 0.1.11__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 +12 -2
- {gradboard-0.1.9.dist-info → gradboard-0.1.11.dist-info}/METADATA +1 -1
- gradboard-0.1.11.dist-info/RECORD +8 -0
- gradboard-0.1.9.dist-info/RECORD +0 -8
- {gradboard-0.1.9.dist-info → gradboard-0.1.11.dist-info}/LICENSE +0 -0
- {gradboard-0.1.9.dist-info → gradboard-0.1.11.dist-info}/WHEEL +0 -0
gradboard/cycles.py
CHANGED
|
@@ -221,7 +221,12 @@ class Cycle:
|
|
|
221
221
|
|
|
222
222
|
|
|
223
223
|
class CycleProduct(Cycle):
|
|
224
|
-
def __init__(self, cycles: List[Cycle], reflect=False):
|
|
224
|
+
def __init__(self, cycles: List[Cycle], reflect=False, normalise: bool = False):
|
|
225
|
+
"""
|
|
226
|
+
Args:
|
|
227
|
+
normalise: if true, the square root of the product is returned (i.e.
|
|
228
|
+
the geometric mean of the two cycles that were multiplied together)
|
|
229
|
+
"""
|
|
225
230
|
main_training_examples = cycles[0].training_examples
|
|
226
231
|
main_batch_size = cycles[0].batch_size
|
|
227
232
|
|
|
@@ -230,11 +235,14 @@ class CycleProduct(Cycle):
|
|
|
230
235
|
|
|
231
236
|
self.cycles = cycles
|
|
232
237
|
self.reflect = reflect
|
|
238
|
+
self.normalise = normalise
|
|
233
239
|
|
|
234
240
|
def generating_function(step: int, total_steps: int) -> float:
|
|
235
241
|
output = self.cycles[0](step)
|
|
236
242
|
for c in self.cycles[1:]:
|
|
237
243
|
output *= c(step % c.total_steps)
|
|
244
|
+
if self.normalise:
|
|
245
|
+
output = math.sqrt(output)
|
|
238
246
|
return output
|
|
239
247
|
|
|
240
248
|
super().__init__(
|
|
@@ -282,7 +290,9 @@ class CycleSequence:
|
|
|
282
290
|
"""
|
|
283
291
|
cycle_ratios = [c.total_steps for c in self.cycles]
|
|
284
292
|
cycle_stats = {k: v * cycle_ratios[0] for k, v in self.cycles[0].stats.items()}
|
|
285
|
-
for i, cycle in enumerate(self.cycles
|
|
293
|
+
for i, cycle in enumerate(self.cycles):
|
|
294
|
+
if i == 0:
|
|
295
|
+
continue # We already did the first one, above
|
|
286
296
|
for k, v in cycle.stats.items():
|
|
287
297
|
cycle_stats[k] += cycle_ratios[i] * v
|
|
288
298
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
+
gradboard/cycles.py,sha256=e_me_9b_995VboDBgDISLLtipEDk03c-_BUgGY4D72Y,10019
|
|
3
|
+
gradboard/optimiser.py,sha256=Iw1piQkQkWdNUW8d9f3iPrvP9qEGVxEKmerK7ATDgOI,6189
|
|
4
|
+
gradboard/scheduler.py,sha256=W146MgdTYz113R3M0qhVpk8kr6L1ioPS3pCFc3MhKYg,6507
|
|
5
|
+
gradboard-0.1.11.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
+
gradboard-0.1.11.dist-info/METADATA,sha256=C9GXzAG88an5j6E2BuJG6ui-er8hN_cqaR0OShXMmmU,2174
|
|
7
|
+
gradboard-0.1.11.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
+
gradboard-0.1.11.dist-info/RECORD,,
|
gradboard-0.1.9.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
gradboard/__init__.py,sha256=57AkHusYwLCsusiVnajH5pMFKioRCj-3IjF9qpdOzE0,69
|
|
2
|
-
gradboard/cycles.py,sha256=88xEt7dyL3jyPHjD7TywDS3bg9tfv4sp6ocO6vPME04,9599
|
|
3
|
-
gradboard/optimiser.py,sha256=Iw1piQkQkWdNUW8d9f3iPrvP9qEGVxEKmerK7ATDgOI,6189
|
|
4
|
-
gradboard/scheduler.py,sha256=W146MgdTYz113R3M0qhVpk8kr6L1ioPS3pCFc3MhKYg,6507
|
|
5
|
-
gradboard-0.1.9.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
6
|
-
gradboard-0.1.9.dist-info/METADATA,sha256=b9v9iVcoAu6VE5AGvXVp9AynLDHPHIdrxdkD309jzmQ,2173
|
|
7
|
-
gradboard-0.1.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
8
|
-
gradboard-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|