gradboard 0.1.10__tar.gz → 0.1.11__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.10
3
+ Version: 0.1.11
4
4
  Summary: Easily snowboard down gnarly loss gradients
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -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__(
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gradboard"
3
- version = "0.1.10"
3
+ version = "0.1.11"
4
4
  description = "Easily snowboard down gnarly loss gradients"
5
5
  authors = [
6
6
  {name = "Nicholas Bailey"}
File without changes
File without changes