deep-learning-core 0.0.2__tar.gz → 0.0.2a4__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.
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/PKG-INFO +65 -7
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/README.md +61 -3
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/pyproject.toml +4 -4
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/technical/3_sweep_system.md +3 -2
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/__init__.py +1 -1
- deep_learning_core-0.0.2a4/src/dl_core/cli.py +233 -0
- deep_learning_core-0.0.2a4/src/dl_core/component_describer.py +351 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/component_scaffold.py +148 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_executor.py +1 -1
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_tracker.py +3 -3
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/registry.py +20 -2
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/init_experiment.py +138 -5
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/template/tracking_utils.py +7 -4
- deep_learning_core-0.0.2a4/src/dl_core/sweep_scaffold.py +107 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/templates/base/base_sweep.yaml +3 -5
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/templates/sweeps/example_sweep.yaml +4 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/sweep_tracker.py +3 -3
- deep_learning_core-0.0.2a4/tests/test_component_describer.py +103 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_component_scaffold.py +84 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_init_experiment.py +54 -4
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/uv.lock +4 -4
- deep_learning_core-0.0.2/src/dl_core/cli.py +0 -100
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/.github/workflows/ci.yml +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/.github/workflows/publish-testpypi.yml +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/.github/workflows/publish.yml +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/.gitignore +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/AGENTS.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/LICENSE +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/plan.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/README.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/guide/1_getting_started.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/guide/2_creating_an_experiment_repository.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/guide/3_local_components_and_sweeps.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/technical/1_configuration.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/technical/2_entry_points.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/technical/4_local_component_loading.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/technical/5_testing.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/tldr/1_install_and_verify.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/readme/tldr/2_create_and_run_an_experiment.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/requirements-ci.txt +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/accelerators/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/accelerators/cpu.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/accelerators/multi_gpu.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/accelerators/single_gpu.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/analysis/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/analysis/sweep_analyzer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/augmentations/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/augmentations/minimal.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/augmentations/standard.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/callbacks/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/callbacks/checkpoint.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/callbacks/early_stopping.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/callbacks/local_metric_tracker.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/callbacks/metric_logger.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/adaptive_computation_trainer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_accelerator.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_biometric_model.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_callback.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_criterion.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_dataset.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_detector.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_metric.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_metric_manager.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_metrics_source.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_model.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_sampler.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_trainer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/base_transform.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/epoch_trainer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/core/sequence_trainer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/criterions/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/criterions/bce_with_logits.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/criterions/crossentropy.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/datasets/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/datasets/standard.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/executors/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/executors/local.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/init_extensions.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metric_managers/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metric_managers/standard_manager.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics/accuracy.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics/auc.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics/f1.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics/halt_steps.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics_sources/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/metrics_sources/local.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/models/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/models/resnet.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/optimizers/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/project.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/schedulers/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/schedulers/cosinewithwarmup.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/single_run.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/config/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/config/config_builder.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/config/config_utils.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/runner.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/template/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/template/template_loader.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/template/template_merger.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/sweep/template/template_validator.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/templates/README.md +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/templates/base/base.yaml +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/templates/presets.yaml +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/trackers/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/trackers/local.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/trainers/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/trainers/standard_trainer.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/artifact_manager.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/common.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/config.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/config_validator.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/distributed_utils.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/ema.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/logging/__init__.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/logging/logger.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/utils/runtime_utils.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/src/dl_core/worker.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/conftest.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_checkpoint_behavior.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_dataset_bases.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_init_extensions.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_local_components.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_local_metric_tracker_callback.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_scaffold_smoke.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_tracking_components.py +0 -0
- {deep_learning_core-0.0.2 → deep_learning_core-0.0.2a4}/tests/test_trainer_hierarchy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deep-learning-core
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2a4
|
|
4
4
|
Summary: Reusable deep learning framework core.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Blazkowiz47/dl-core
|
|
6
6
|
Project-URL: Documentation, https://github.com/Blazkowiz47/dl-core/tree/main/readme
|
|
@@ -53,13 +53,13 @@ Requires-Dist: torch
|
|
|
53
53
|
Requires-Dist: torchvision
|
|
54
54
|
Requires-Dist: tqdm
|
|
55
55
|
Provides-Extra: azure
|
|
56
|
-
Requires-Dist: deep-learning-azure; extra == 'azure'
|
|
56
|
+
Requires-Dist: deep-learning-azure==0.0.2a4; extra == 'azure'
|
|
57
57
|
Provides-Extra: dev
|
|
58
58
|
Requires-Dist: pytest; extra == 'dev'
|
|
59
59
|
Provides-Extra: mlflow
|
|
60
|
-
Requires-Dist: deep-learning-mlflow; extra == 'mlflow'
|
|
60
|
+
Requires-Dist: deep-learning-mlflow==0.0.2a4; extra == 'mlflow'
|
|
61
61
|
Provides-Extra: wandb
|
|
62
|
-
Requires-Dist: deep-learning-wandb; extra == 'wandb'
|
|
62
|
+
Requires-Dist: deep-learning-wandb==0.0.2a4; extra == 'wandb'
|
|
63
63
|
Description-Content-Type: text/markdown
|
|
64
64
|
|
|
65
65
|
# deep-learning-core
|
|
@@ -226,6 +226,7 @@ Then:
|
|
|
226
226
|
- `src/datasets/my_exp.py`
|
|
227
227
|
- `configs/base.yaml`
|
|
228
228
|
- `experiments/lr_sweep.yaml`
|
|
229
|
+
- `AGENTS.md`
|
|
229
230
|
2. implement the generated dataset wrapper under `src/datasets/my_exp.py`
|
|
230
231
|
3. adjust `configs/base.yaml` so it points at the dataset/model/trainer you want
|
|
231
232
|
4. start with:
|
|
@@ -256,13 +257,68 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
256
257
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
257
258
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
258
259
|
|
|
259
|
-
|
|
260
|
+
## Scaffold Commands
|
|
261
|
+
|
|
262
|
+
Each `dl-core add ...` command creates the new module and updates the matching
|
|
263
|
+
local package `__init__.py` export list under `src/`.
|
|
264
|
+
|
|
265
|
+
Common local component scaffolds:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
uv run dl-core add model MyResNet
|
|
269
|
+
uv run dl-core add trainer MyTrainer
|
|
270
|
+
uv run dl-core add callback MyMetrics
|
|
271
|
+
uv run dl-core add metric_manager MyManager
|
|
272
|
+
uv run dl-core add sampler MySampler
|
|
273
|
+
uv run dl-core add criterion MyLoss
|
|
274
|
+
uv run dl-core add augmentation MyAugmentation
|
|
275
|
+
uv run dl-core add metric MyMetric
|
|
276
|
+
uv run dl-core add executor MyExecutor
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Sweep scaffolds are supported too:
|
|
260
280
|
|
|
261
281
|
```bash
|
|
262
|
-
uv run dl-core add
|
|
282
|
+
uv run dl-core add sweep DebugSweep
|
|
283
|
+
uv run dl-core add sweep AzureEval --tracking azure_mlflow
|
|
284
|
+
uv run dl-core add sweep MlflowBaseline --tracking mlflow
|
|
285
|
+
uv run dl-core add sweep WandbAblation --tracking wandb
|
|
263
286
|
```
|
|
264
287
|
|
|
265
|
-
|
|
288
|
+
Generated sweep files:
|
|
289
|
+
|
|
290
|
+
- live under `experiments/`
|
|
291
|
+
- extend `../configs/base_sweep.yaml`
|
|
292
|
+
- include runnable defaults in `fixed`
|
|
293
|
+
- start with `grid: {}`
|
|
294
|
+
- let the tracker derive sweep naming from the filename unless
|
|
295
|
+
`tracking.sweep_name` overrides it
|
|
296
|
+
|
|
297
|
+
You can inspect registered components and built-in base classes directly from
|
|
298
|
+
the CLI:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
uv run dl-core describe dataset my_dataset --root-dir .
|
|
302
|
+
uv run dl-core describe model my_resnet --root-dir .
|
|
303
|
+
uv run dl-core describe class dl_core.core.FrameWrapper
|
|
304
|
+
uv run dl-core describe class dl_azure.datasets.AzureComputeMultiFrameWrapper
|
|
305
|
+
uv run dl-core describe dataset my_dataset --root-dir . --json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The describe command shows:
|
|
309
|
+
|
|
310
|
+
- resolved class and registered names
|
|
311
|
+
- constructor signature
|
|
312
|
+
- inheritance chain
|
|
313
|
+
- docstring
|
|
314
|
+
- declared properties
|
|
315
|
+
- class-level attributes
|
|
316
|
+
- public methods defined on the class
|
|
317
|
+
|
|
318
|
+
It does not discover instance attributes created dynamically inside `__init__`
|
|
319
|
+
without constructing the class.
|
|
320
|
+
|
|
321
|
+
Dataset scaffolds can target a specific wrapper base:
|
|
266
322
|
|
|
267
323
|
```bash
|
|
268
324
|
uv run dl-core add dataset MyDataset
|
|
@@ -276,6 +332,8 @@ When `dl-azure` is importable, the dataset scaffold also exposes Azure bases:
|
|
|
276
332
|
```bash
|
|
277
333
|
uv run dl-core add dataset AzureFrames --base azure_compute_frame
|
|
278
334
|
uv run dl-core add dataset AzureSeq --base azure_compute_multiframe
|
|
335
|
+
uv run dl-core add dataset AzureStream --base azure_streaming
|
|
336
|
+
uv run dl-core add dataset AzureStreamSeq --base azure_streaming_multiframe
|
|
279
337
|
```
|
|
280
338
|
|
|
281
339
|
Plain `deep-learning-core` currently exposes dataset bases for:
|
|
@@ -162,6 +162,7 @@ Then:
|
|
|
162
162
|
- `src/datasets/my_exp.py`
|
|
163
163
|
- `configs/base.yaml`
|
|
164
164
|
- `experiments/lr_sweep.yaml`
|
|
165
|
+
- `AGENTS.md`
|
|
165
166
|
2. implement the generated dataset wrapper under `src/datasets/my_exp.py`
|
|
166
167
|
3. adjust `configs/base.yaml` so it points at the dataset/model/trainer you want
|
|
167
168
|
4. start with:
|
|
@@ -192,13 +193,68 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
192
193
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
193
194
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
## Scaffold Commands
|
|
197
|
+
|
|
198
|
+
Each `dl-core add ...` command creates the new module and updates the matching
|
|
199
|
+
local package `__init__.py` export list under `src/`.
|
|
200
|
+
|
|
201
|
+
Common local component scaffolds:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
uv run dl-core add model MyResNet
|
|
205
|
+
uv run dl-core add trainer MyTrainer
|
|
206
|
+
uv run dl-core add callback MyMetrics
|
|
207
|
+
uv run dl-core add metric_manager MyManager
|
|
208
|
+
uv run dl-core add sampler MySampler
|
|
209
|
+
uv run dl-core add criterion MyLoss
|
|
210
|
+
uv run dl-core add augmentation MyAugmentation
|
|
211
|
+
uv run dl-core add metric MyMetric
|
|
212
|
+
uv run dl-core add executor MyExecutor
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Sweep scaffolds are supported too:
|
|
196
216
|
|
|
197
217
|
```bash
|
|
198
|
-
uv run dl-core add
|
|
218
|
+
uv run dl-core add sweep DebugSweep
|
|
219
|
+
uv run dl-core add sweep AzureEval --tracking azure_mlflow
|
|
220
|
+
uv run dl-core add sweep MlflowBaseline --tracking mlflow
|
|
221
|
+
uv run dl-core add sweep WandbAblation --tracking wandb
|
|
199
222
|
```
|
|
200
223
|
|
|
201
|
-
|
|
224
|
+
Generated sweep files:
|
|
225
|
+
|
|
226
|
+
- live under `experiments/`
|
|
227
|
+
- extend `../configs/base_sweep.yaml`
|
|
228
|
+
- include runnable defaults in `fixed`
|
|
229
|
+
- start with `grid: {}`
|
|
230
|
+
- let the tracker derive sweep naming from the filename unless
|
|
231
|
+
`tracking.sweep_name` overrides it
|
|
232
|
+
|
|
233
|
+
You can inspect registered components and built-in base classes directly from
|
|
234
|
+
the CLI:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
uv run dl-core describe dataset my_dataset --root-dir .
|
|
238
|
+
uv run dl-core describe model my_resnet --root-dir .
|
|
239
|
+
uv run dl-core describe class dl_core.core.FrameWrapper
|
|
240
|
+
uv run dl-core describe class dl_azure.datasets.AzureComputeMultiFrameWrapper
|
|
241
|
+
uv run dl-core describe dataset my_dataset --root-dir . --json
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
The describe command shows:
|
|
245
|
+
|
|
246
|
+
- resolved class and registered names
|
|
247
|
+
- constructor signature
|
|
248
|
+
- inheritance chain
|
|
249
|
+
- docstring
|
|
250
|
+
- declared properties
|
|
251
|
+
- class-level attributes
|
|
252
|
+
- public methods defined on the class
|
|
253
|
+
|
|
254
|
+
It does not discover instance attributes created dynamically inside `__init__`
|
|
255
|
+
without constructing the class.
|
|
256
|
+
|
|
257
|
+
Dataset scaffolds can target a specific wrapper base:
|
|
202
258
|
|
|
203
259
|
```bash
|
|
204
260
|
uv run dl-core add dataset MyDataset
|
|
@@ -212,6 +268,8 @@ When `dl-azure` is importable, the dataset scaffold also exposes Azure bases:
|
|
|
212
268
|
```bash
|
|
213
269
|
uv run dl-core add dataset AzureFrames --base azure_compute_frame
|
|
214
270
|
uv run dl-core add dataset AzureSeq --base azure_compute_multiframe
|
|
271
|
+
uv run dl-core add dataset AzureStream --base azure_streaming
|
|
272
|
+
uv run dl-core add dataset AzureStreamSeq --base azure_streaming_multiframe
|
|
215
273
|
```
|
|
216
274
|
|
|
217
275
|
Plain `deep-learning-core` currently exposes dataset bases for:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deep-learning-core"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.2a4"
|
|
8
8
|
description = "Reusable deep learning framework core."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -49,13 +49,13 @@ dependencies = [
|
|
|
49
49
|
|
|
50
50
|
[project.optional-dependencies]
|
|
51
51
|
azure = [
|
|
52
|
-
"deep-learning-azure",
|
|
52
|
+
"deep-learning-azure==0.0.2a4",
|
|
53
53
|
]
|
|
54
54
|
mlflow = [
|
|
55
|
-
"deep-learning-mlflow",
|
|
55
|
+
"deep-learning-mlflow==0.0.2a4",
|
|
56
56
|
]
|
|
57
57
|
wandb = [
|
|
58
|
-
"deep-learning-wandb",
|
|
58
|
+
"deep-learning-wandb==0.0.2a4",
|
|
59
59
|
]
|
|
60
60
|
dev = [
|
|
61
61
|
"pytest",
|
|
@@ -25,7 +25,8 @@ default_grid:
|
|
|
25
25
|
optimizers.lr: [1e-4, 5e-4]
|
|
26
26
|
|
|
27
27
|
tracking:
|
|
28
|
-
|
|
28
|
+
# sweep_name: my_custom_sweep
|
|
29
|
+
# Optional override. Defaults to the sweep filename.
|
|
29
30
|
run_name_template: "lr_{optimizers.lr}"
|
|
30
31
|
|
|
31
32
|
seeds: [2025]
|
|
@@ -71,7 +72,7 @@ That local artifact contract is what powers `dl-analyze-sweep`.
|
|
|
71
72
|
Sweep templates support a `tracking` block used for:
|
|
72
73
|
|
|
73
74
|
- run name templates
|
|
74
|
-
-
|
|
75
|
+
- sweep names
|
|
75
76
|
- description templates
|
|
76
77
|
- auto-generated tags
|
|
77
78
|
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"""User-facing command line entry point for ``dl-core`` utilities."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
|
|
7
|
+
from dl_core.component_describer import (
|
|
8
|
+
describe_component,
|
|
9
|
+
format_description,
|
|
10
|
+
format_description_json,
|
|
11
|
+
list_supported_describe_types,
|
|
12
|
+
normalize_describe_type,
|
|
13
|
+
)
|
|
14
|
+
from dl_core.component_scaffold import (
|
|
15
|
+
create_component_scaffold,
|
|
16
|
+
list_supported_dataset_bases,
|
|
17
|
+
list_supported_component_types,
|
|
18
|
+
normalize_component_type,
|
|
19
|
+
)
|
|
20
|
+
from dl_core.sweep_scaffold import (
|
|
21
|
+
create_sweep_scaffold,
|
|
22
|
+
list_supported_tracking_backends,
|
|
23
|
+
normalize_tracking_backend,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _list_supported_add_targets() -> list[str]:
|
|
28
|
+
"""Return supported targets for ``dl-core add``."""
|
|
29
|
+
return sorted([*list_supported_component_types(), "sweep"])
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def main(argv: list[str] | None = None) -> int:
|
|
33
|
+
"""Run the ``dl-core`` command line interface."""
|
|
34
|
+
parser = argparse.ArgumentParser(
|
|
35
|
+
prog="dl-core",
|
|
36
|
+
description="Utilities for working with dl-core experiment repositories.",
|
|
37
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
38
|
+
epilog=(
|
|
39
|
+
"Common first steps:\n"
|
|
40
|
+
" dl-init-experiment --name my-exp --root-dir .\n"
|
|
41
|
+
" cd my-exp\n"
|
|
42
|
+
" uv run dl-core add dataset LocalDataset\n"
|
|
43
|
+
" uv run dl-core add sweep DebugSweep\n"
|
|
44
|
+
" uv run dl-core describe dataset LocalDataset --root-dir .\n"
|
|
45
|
+
" uv run dl-core add model MyResNet\n"
|
|
46
|
+
" uv run dl-core add callback MyMetrics\n"
|
|
47
|
+
" uv run dl-run --config configs/base.yaml"
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
51
|
+
|
|
52
|
+
add_parser = subparsers.add_parser(
|
|
53
|
+
"add",
|
|
54
|
+
help="Create a local component or sweep scaffold inside an experiment repository.",
|
|
55
|
+
description=(
|
|
56
|
+
"Create a local component or sweep scaffold inside an experiment "
|
|
57
|
+
"repository.\n\nUse this after dl-init-experiment when you want an "
|
|
58
|
+
"extra local dataset, model, callback, trainer, or another sweep "
|
|
59
|
+
"file.\nComponent generation writes the module and updates the "
|
|
60
|
+
"matching src/<package>/__init__.py export list for you."
|
|
61
|
+
),
|
|
62
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
63
|
+
epilog=(
|
|
64
|
+
"Dataset examples:\n"
|
|
65
|
+
" dl-core add dataset LocalDataset\n"
|
|
66
|
+
" dl-core add dataset FrameDataset --base frame\n"
|
|
67
|
+
" dl-core add dataset TextDataset --base text_sequence\n"
|
|
68
|
+
" dl-core add dataset ActDataset --base adaptive_computation\n"
|
|
69
|
+
" dl-core add dataset AzureFrames --base azure_compute_frame\n"
|
|
70
|
+
" dl-core add dataset AzureSeq --base azure_compute_multiframe\n\n"
|
|
71
|
+
"Sweep examples:\n"
|
|
72
|
+
" dl-core add sweep DebugSweep\n"
|
|
73
|
+
" dl-core add sweep AzureEval --tracking azure_mlflow\n"
|
|
74
|
+
" dl-core add sweep WandbAblation --tracking wandb\n\n"
|
|
75
|
+
"Other component examples:\n"
|
|
76
|
+
" dl-core add model MyResNet\n"
|
|
77
|
+
" dl-core add trainer MyTrainer\n"
|
|
78
|
+
" dl-core add callback MyMetrics\n"
|
|
79
|
+
" dl-core add metric_manager MyManager\n"
|
|
80
|
+
" dl-core add sampler MySampler\n"
|
|
81
|
+
" dl-core add criterion MyLoss\n"
|
|
82
|
+
" dl-core add augmentation MyAugmentation\n"
|
|
83
|
+
" dl-core add metric MyMetric\n"
|
|
84
|
+
" dl-core add executor MyExecutor"
|
|
85
|
+
),
|
|
86
|
+
)
|
|
87
|
+
add_parser.add_argument(
|
|
88
|
+
"component_type",
|
|
89
|
+
help=(
|
|
90
|
+
"Component type to generate. Supported values: "
|
|
91
|
+
f"{', '.join(_list_supported_add_targets())}"
|
|
92
|
+
),
|
|
93
|
+
)
|
|
94
|
+
add_parser.add_argument(
|
|
95
|
+
"name",
|
|
96
|
+
help="Display name for the new component. It will also be normalized.",
|
|
97
|
+
)
|
|
98
|
+
add_parser.add_argument(
|
|
99
|
+
"--base",
|
|
100
|
+
help=(
|
|
101
|
+
"Dataset scaffold base to use when component_type is 'dataset'. "
|
|
102
|
+
"Supported values in this environment: "
|
|
103
|
+
f"{', '.join(list_supported_dataset_bases())}."
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
add_parser.add_argument(
|
|
107
|
+
"--tracking",
|
|
108
|
+
default="local",
|
|
109
|
+
help=(
|
|
110
|
+
"Tracking backend to scaffold when component_type is 'sweep'. "
|
|
111
|
+
"Supported values: "
|
|
112
|
+
f"{', '.join(list_supported_tracking_backends())}. "
|
|
113
|
+
"Defaults to local."
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
add_parser.add_argument(
|
|
117
|
+
"--root-dir",
|
|
118
|
+
default=".",
|
|
119
|
+
help=(
|
|
120
|
+
"Path inside the target experiment repository. "
|
|
121
|
+
"Defaults to the current directory."
|
|
122
|
+
),
|
|
123
|
+
)
|
|
124
|
+
add_parser.add_argument(
|
|
125
|
+
"--force",
|
|
126
|
+
action="store_true",
|
|
127
|
+
help="Overwrite an existing component scaffold if it already exists.",
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
describe_parser = subparsers.add_parser(
|
|
131
|
+
"describe",
|
|
132
|
+
help="Describe a registered component class or importable base class.",
|
|
133
|
+
description=(
|
|
134
|
+
"Inspect a registered component or importable class.\n\n"
|
|
135
|
+
"Use this when you want constructor signatures, inheritance, "
|
|
136
|
+
"properties, class attributes, and public methods without opening "
|
|
137
|
+
"the source code first."
|
|
138
|
+
),
|
|
139
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
140
|
+
epilog=(
|
|
141
|
+
"Examples:\n"
|
|
142
|
+
" dl-core describe dataset my_dataset --root-dir .\n"
|
|
143
|
+
" dl-core describe model tall_swin --root-dir .\n"
|
|
144
|
+
" dl-core describe class dl_core.core.FrameWrapper\n"
|
|
145
|
+
" dl-core describe class dl_azure.datasets.AzureComputeMultiFrameWrapper\n"
|
|
146
|
+
" dl-core describe dataset ocim_multiframe --root-dir . --json"
|
|
147
|
+
),
|
|
148
|
+
)
|
|
149
|
+
describe_parser.add_argument(
|
|
150
|
+
"component_type",
|
|
151
|
+
help=(
|
|
152
|
+
"Describe target type. Supported values: "
|
|
153
|
+
f"{', '.join(list_supported_describe_types())}"
|
|
154
|
+
),
|
|
155
|
+
)
|
|
156
|
+
describe_parser.add_argument(
|
|
157
|
+
"name",
|
|
158
|
+
help=(
|
|
159
|
+
"Registered component name or fully qualified class path when "
|
|
160
|
+
"component_type is 'class'."
|
|
161
|
+
),
|
|
162
|
+
)
|
|
163
|
+
describe_parser.add_argument(
|
|
164
|
+
"--root-dir",
|
|
165
|
+
default=".",
|
|
166
|
+
help=(
|
|
167
|
+
"Path inside the target experiment repository. "
|
|
168
|
+
"Defaults to the current directory."
|
|
169
|
+
),
|
|
170
|
+
)
|
|
171
|
+
describe_parser.add_argument(
|
|
172
|
+
"--json",
|
|
173
|
+
action="store_true",
|
|
174
|
+
help="Print the description as JSON instead of human-readable text.",
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
args = parser.parse_args(argv)
|
|
178
|
+
if args.command == "add":
|
|
179
|
+
normalized_add_target = args.component_type.strip().lower().replace(
|
|
180
|
+
"-", "_"
|
|
181
|
+
).replace(" ", "_")
|
|
182
|
+
if normalized_add_target == "sweep":
|
|
183
|
+
if args.base:
|
|
184
|
+
parser.error(
|
|
185
|
+
"--base is only supported when component_type is 'dataset'."
|
|
186
|
+
)
|
|
187
|
+
normalize_tracking_backend(args.tracking)
|
|
188
|
+
sweep_path = create_sweep_scaffold(
|
|
189
|
+
args.name,
|
|
190
|
+
root_dir=args.root_dir,
|
|
191
|
+
tracking_backend=args.tracking,
|
|
192
|
+
force=args.force,
|
|
193
|
+
)
|
|
194
|
+
print(f"Created sweep scaffold: {sweep_path}")
|
|
195
|
+
return 0
|
|
196
|
+
|
|
197
|
+
if args.tracking != "local":
|
|
198
|
+
parser.error(
|
|
199
|
+
"--tracking is only supported when component_type is 'sweep'."
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if args.base and normalize_component_type(args.component_type) != "dataset":
|
|
203
|
+
parser.error("--base is only supported when component_type is 'dataset'.")
|
|
204
|
+
|
|
205
|
+
component_path = create_component_scaffold(
|
|
206
|
+
component_type=args.component_type,
|
|
207
|
+
name=args.name,
|
|
208
|
+
root_dir=args.root_dir,
|
|
209
|
+
dataset_base=args.base,
|
|
210
|
+
force=args.force,
|
|
211
|
+
)
|
|
212
|
+
print(f"Created component scaffold: {component_path}")
|
|
213
|
+
return 0
|
|
214
|
+
|
|
215
|
+
if args.command == "describe":
|
|
216
|
+
normalize_describe_type(args.component_type)
|
|
217
|
+
description = describe_component(
|
|
218
|
+
args.component_type,
|
|
219
|
+
args.name,
|
|
220
|
+
root_dir=args.root_dir,
|
|
221
|
+
)
|
|
222
|
+
if args.json:
|
|
223
|
+
print(format_description_json(description))
|
|
224
|
+
else:
|
|
225
|
+
print(format_description(description))
|
|
226
|
+
return 0
|
|
227
|
+
|
|
228
|
+
parser.error(f"Unsupported command: {args.command}")
|
|
229
|
+
return 1
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
if __name__ == "__main__":
|
|
233
|
+
raise SystemExit(main())
|