k1lib.schedule module

k1lib.schedule.combine(lambdas: List[Callable[[float], float]], ratios: Optional[List[float]] = None)Callable[[float], float][source]

Combine multiple different schedules.

Parameters
  • ratios – weighting diferent functions. Does not have to add up to 1.

  • lambdas – functions with 1 float input in [0, 1]

k1lib.schedule.decorate(f: Callable[[float, float, float], float])Callable[[float], float][source]

Decorator, transforms f(low, high, x) to (low, high) -> f(x).

k1lib.schedule.linear(low, high)[source]
k1lib.schedule.cosine(low, high)[source]
k1lib.schedule.oneCycle(low, high)[source]
k1lib.schedule.decay(low, high)[source]
class k1lib.schedule.Schedule(param: str, scheduleF: Callable[[float], float])[source]

Bases: object

startBatch(paramGroup: dict, progress: float)[source]
property value
static linear(param: str, low: float, high: float)Callable[[float], float][source]

Sharply goes from low to high

static cosine(param: str, low: float, high: float)Callable[[float], float][source]

Smoothly goes from low to high

static oneCycle(param: str, low: float, high: float, upPortion: float = 0.3)Callable[[float], float][source]

Goes from middle-low (0.8*low + 0.2*high) to high to low

Parameters

upPortion – the percent of portion that goes up

static decay(param: str, low: float, high: float)Callable[[float], float][source]

Rises/drops quickly, then rate of change gets smaller and smaller

class k1lib.schedule.ParamScheduler(css: str, schedules: Union[List[k1lib.schedule.Schedule], k1lib.schedule.Schedule])[source]

Bases: k1lib.callbacks.callbacks.Callback

Schedules a param in parts of the network.

Parameters
  • css – the selected parts of the network to schedule

  • schedules – (obvious)

dependsOn: Set[str]
startRun()

meta:private