gradboard 0.1.8__tar.gz → 0.1.9__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gradboard
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Easily snowboard down gnarly loss gradients
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -178,6 +178,7 @@ class Cycle:
178
178
 
179
179
  return list(zip(widths, heights, strict=True))
180
180
 
181
+ @property
181
182
  def stats(self) -> float:
182
183
  """
183
184
  Returns the area (as a percentage of the area of a curve where the learning
@@ -271,3 +272,18 @@ class CycleSequence:
271
272
 
272
273
  def __len__(self):
273
274
  return self.total_steps
275
+
276
+ @property
277
+ def stats(self) -> float:
278
+ """
279
+ Returns the area (as a percentage of the area of a curve where the learning
280
+ rate is constant max_lr), percentage ascent steps and percentage descent
281
+ steps of a learning rate schedule.
282
+ """
283
+ cycle_ratios = [c.total_steps for c in self.cycles]
284
+ cycle_stats = {k: v * cycle_ratios[0] for k, v in self.cycles[0].stats.items()}
285
+ for i, cycle in enumerate(self.cycles[1:]):
286
+ for k, v in cycle.stats.items():
287
+ cycle_stats[k] += cycle_ratios[i] * v
288
+
289
+ return {k: v / self.total_steps for k, v in cycle_stats.items()}
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gradboard"
3
- version = "0.1.8"
3
+ version = "0.1.9"
4
4
  description = "Easily snowboard down gnarly loss gradients"
5
5
  authors = [
6
6
  {name = "Nicholas Bailey"}
File without changes
File without changes