gensbi.utils.misc#
Attributes#
Functions#
|
Returns the value wrapped in color codes based on thresholds. |
|
Scale learning rate based on batch size using square root scaling. |
Module Contents#
- gensbi.utils.misc.get_colored_value(val, thresholds=(1.1, 1.2))[source]#
Returns the value wrapped in color codes based on thresholds.
- Parameters:
val (float) – The value to color.
thresholds (tuple of float) – Thresholds for coloring (red/yellow, yellow/green). Defaults to (1.1, 1.2).
- Returns:
The colored string representation of the value.
- Return type:
str
- gensbi.utils.misc.scale_lr(batch_size, base_lr=0.0001, reference_batch_size=256)[source]#
Scale learning rate based on batch size using square root scaling.
- Parameters:
batch_size (int) – The current batch size.
base_lr (float) – The base learning rate for the reference batch size.
reference_batch_size (int, optional) – The reference batch size. Defaults to 256.
- Returns:
The adjusted learning rate.
- Return type:
float