kostyl-toolkit 0.1.26__tar.gz → 0.1.28__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.
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/PKG-INFO +1 -1
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/configs/hyperparams.py +2 -2
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/schedulers/cosine.py +9 -9
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/pyproject.toml +1 -1
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/README.md +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/clearml/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/clearml/dataset_utils.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/clearml/logging_utils.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/clearml/pulling_utils.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/configs/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/configs/base_model.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/configs/training_settings.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/dist_utils.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/checkpoint.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/early_stopping.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/registry_uploader.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/extenstions/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/extenstions/custom_module.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/extenstions/pretrained_model.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/loggers/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/loggers/tb_logger.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/steps_estimation.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/metrics_formatting.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/params_groups.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/schedulers/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/schedulers/base.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/schedulers/composite.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/schedulers/linear.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/utils/__init__.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/utils/dict_manipulations.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/utils/fs.py +0 -0
- {kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/utils/logging.py +0 -0
|
@@ -23,7 +23,7 @@ class Lr(BaseModel):
|
|
|
23
23
|
default=None, gt=0, lt=1, validate_default=False
|
|
24
24
|
)
|
|
25
25
|
warmup_value: float | None = Field(default=None, gt=0, validate_default=False)
|
|
26
|
-
|
|
26
|
+
base_value: float
|
|
27
27
|
final_value: float | None = Field(default=None, gt=0, validate_default=False)
|
|
28
28
|
|
|
29
29
|
@model_validator(mode="after")
|
|
@@ -56,7 +56,7 @@ class WeightDecay(BaseModel):
|
|
|
56
56
|
"""Weight decay hyperparameters configuration."""
|
|
57
57
|
|
|
58
58
|
use_scheduler: bool = False
|
|
59
|
-
|
|
59
|
+
base_value: float
|
|
60
60
|
final_value: float | None = None
|
|
61
61
|
|
|
62
62
|
@model_validator(mode="after")
|
|
@@ -13,7 +13,7 @@ class _CosineSchedulerCore(BaseScheduler):
|
|
|
13
13
|
self,
|
|
14
14
|
param_name: str,
|
|
15
15
|
num_iters: int,
|
|
16
|
-
|
|
16
|
+
base_value: float,
|
|
17
17
|
final_value: float,
|
|
18
18
|
warmup_ratio: float | None = None,
|
|
19
19
|
warmup_value: float | None = None,
|
|
@@ -32,7 +32,7 @@ class _CosineSchedulerCore(BaseScheduler):
|
|
|
32
32
|
|
|
33
33
|
self.param_name = param_name
|
|
34
34
|
self.num_iters = num_iters
|
|
35
|
-
self.
|
|
35
|
+
self.base_value = base_value
|
|
36
36
|
self.final_value = final_value
|
|
37
37
|
|
|
38
38
|
self.warmup_ratio = warmup_ratio
|
|
@@ -41,7 +41,7 @@ class _CosineSchedulerCore(BaseScheduler):
|
|
|
41
41
|
self.freeze_ratio = freeze_ratio
|
|
42
42
|
|
|
43
43
|
self.scheduler_values: npt.NDArray[np.float64] = np.array([], dtype=np.float64)
|
|
44
|
-
self.current_value_ = self.
|
|
44
|
+
self.current_value_ = self.base_value
|
|
45
45
|
return
|
|
46
46
|
|
|
47
47
|
def _create_scheduler(self) -> None:
|
|
@@ -57,7 +57,7 @@ class _CosineSchedulerCore(BaseScheduler):
|
|
|
57
57
|
if self.warmup_ratio is not None and self.warmup_value is not None:
|
|
58
58
|
warmup_iters = int(self.num_iters * self.warmup_ratio)
|
|
59
59
|
warmup_schedule = np.linspace(
|
|
60
|
-
self.warmup_value, self.
|
|
60
|
+
self.warmup_value, self.base_value, warmup_iters, dtype=np.float64
|
|
61
61
|
)
|
|
62
62
|
else:
|
|
63
63
|
warmup_iters = 0
|
|
@@ -69,7 +69,7 @@ class _CosineSchedulerCore(BaseScheduler):
|
|
|
69
69
|
|
|
70
70
|
# Create cosine schedule
|
|
71
71
|
iters = np.arange(cosine_annealing_iters)
|
|
72
|
-
schedule = self.final_value + 0.5 * (self.
|
|
72
|
+
schedule = self.final_value + 0.5 * (self.base_value - self.final_value) * (
|
|
73
73
|
1 + np.cos(np.pi * iters / len(iters))
|
|
74
74
|
)
|
|
75
75
|
|
|
@@ -118,7 +118,7 @@ class CosineScheduler(_CosineSchedulerCore):
|
|
|
118
118
|
optimizer: torch.optim.Optimizer,
|
|
119
119
|
param_group_field: str,
|
|
120
120
|
num_iters: int,
|
|
121
|
-
|
|
121
|
+
base_value: float,
|
|
122
122
|
final_value: float,
|
|
123
123
|
warmup_ratio: float | None = None,
|
|
124
124
|
warmup_value: float | None = None,
|
|
@@ -135,9 +135,9 @@ class CosineScheduler(_CosineSchedulerCore):
|
|
|
135
135
|
optimizer: Optimizer whose param groups are updated in-place.
|
|
136
136
|
param_group_field: Name of the field that receives the scheduled value.
|
|
137
137
|
num_iters: Number of scheduler iterations before clamping at ``final_value``.
|
|
138
|
-
|
|
138
|
+
base_value: Value used on the first cosine step (after warmup/freeze).
|
|
139
139
|
final_value: Value approached as iterations progress.
|
|
140
|
-
warmup_ratio: Optional fraction of iterations to linearly ramp from ``warmup_value`` to ``
|
|
140
|
+
warmup_ratio: Optional fraction of iterations to linearly ramp from ``warmup_value`` to ``base_value``.
|
|
141
141
|
warmup_value: Starting value for the warmup ramp.
|
|
142
142
|
freeze_ratio: Optional fraction of iterations to keep the value frozen at zero at the beginning.
|
|
143
143
|
multiplier_field: Optional per-group multiplier applied to the scheduled value.
|
|
@@ -154,7 +154,7 @@ class CosineScheduler(_CosineSchedulerCore):
|
|
|
154
154
|
super().__init__(
|
|
155
155
|
param_name=param_group_field,
|
|
156
156
|
num_iters=num_iters,
|
|
157
|
-
|
|
157
|
+
base_value=base_value,
|
|
158
158
|
final_value=final_value,
|
|
159
159
|
warmup_ratio=warmup_ratio,
|
|
160
160
|
warmup_value=warmup_value,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/early_stopping.py
RENAMED
|
File without changes
|
{kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/callbacks/registry_uploader.py
RENAMED
|
File without changes
|
|
File without changes
|
{kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/extenstions/custom_module.py
RENAMED
|
File without changes
|
{kostyl_toolkit-0.1.26 → kostyl_toolkit-0.1.28}/kostyl/ml/lightning/extenstions/pretrained_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|