deep-learning-core 0.0.26__tar.gz → 0.0.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.
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/PKG-INFO +33 -2
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/README.md +32 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/pyproject.toml +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/README.md +10 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/6_reinforcement_learning.md +97 -4
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/__init__.py +2 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/component_describer.py +8 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/component_scaffold.py +56 -27
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/__init__.py +24 -1
- deep_learning_core-0.0.28/src/dl_core/core/base_episode_manager.py +461 -0
- deep_learning_core-0.0.28/src/dl_core/core/batched_environment.py +266 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/registry.py +8 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/replay_buffer.py +89 -15
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/rl_trainer.py +541 -40
- deep_learning_core-0.0.28/src/dl_core/core/rl_types.py +205 -0
- deep_learning_core-0.0.28/src/dl_core/core/rollout_buffer.py +418 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/environments/__init__.py +10 -7
- deep_learning_core-0.0.28/src/dl_core/environments/gymnasium_vector_environment.py +38 -0
- deep_learning_core-0.0.28/src/dl_core/episode_managers/__init__.py +6 -0
- deep_learning_core-0.0.28/src/dl_core/episode_managers/standard.py +52 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/init_experiment.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/project.py +1 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/dqn_trainer.py +198 -80
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/ppo_trainer.py +200 -58
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/q_learning_trainer.py +81 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/sac_trainer.py +165 -46
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_component_describer.py +18 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_component_scaffold.py +37 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_dqn_trainer.py +165 -2
- deep_learning_core-0.0.28/tests/test_episode_manager.py +278 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_init_experiment.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_ppo_trainer.py +201 -2
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_q_learning_trainer.py +32 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_rl_environment_contracts.py +69 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_rl_preflight.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_rl_trainer.py +47 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_sac_trainer.py +88 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/uv.lock +1 -1
- deep_learning_core-0.0.26/src/dl_core/core/rl_types.py +0 -83
- deep_learning_core-0.0.26/src/dl_core/core/rollout_buffer.py +0 -223
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/.github/workflows/ci.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/.github/workflows/publish-testpypi.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/.github/workflows/publish.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/.gitignore +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/AGENTS.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/LICENSE +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/plan.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/guide/1_getting_started.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/guide/2_creating_an_experiment_repository.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/guide/3_local_components_and_sweeps.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/1_configuration.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/2_entry_points.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/3_sweep_system.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/4_local_component_loading.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/5_testing.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/tldr/1_install_and_verify.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/tldr/2_create_and_run_an_experiment.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/accelerators/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/accelerators/cpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/accelerators/multi_gpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/accelerators/single_gpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/analysis/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/analysis/sweep_analyzer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/augmentations/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/augmentations/minimal.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/augmentations/standard.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/checkpoint.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/dataset_refresh.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/early_stopping.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/local_metric_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/callbacks/metric_logger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/adaptive_computation_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_accelerator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_biometric_model.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_callback.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_criterion.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_dataset.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_detector.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_executor.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_metric.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_metric_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_metrics_source.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_model.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_sampler.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/base_transform.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/config_metadata.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/epoch_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/core/sequence_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/criterions/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/criterions/bce_with_logits.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/criterions/crossentropy.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/dataset_inspect.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/datasets/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/datasets/standard.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/environments/gymnasium_environment.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/executors/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/executors/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/init_extensions.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metric_managers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metric_managers/standard_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics/accuracy.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics/auc.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics/f1.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics/halt_steps.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics_sources/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/metrics_sources/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/migrate.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/models/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/models/dqn.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/models/ppo.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/models/resnet.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/models/sac.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/optimizers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/py.typed +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/samplers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/samplers/label.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/schedulers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/schedulers/cosinewithwarmup.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/single_run.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/smoke.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/config/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/config/config_builder.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/config/config_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/runner.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/template/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/template/template_loader.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/template/template_merger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/template/template_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep/template/tracking_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sweep_scaffold.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/sync.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/templates/README.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/templates/base/base.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/templates/base/base_sweep.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/templates/presets.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/templates/sweeps/example_sweep.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trackers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trackers/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/trainers/standard_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/artifact_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/common.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/config.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/config_names.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/config_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/distributed_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/ema.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/logging/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/logging/logger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/runtime_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/utils/sweep_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/src/dl_core/worker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/conftest.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_checkpoint_behavior.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_config_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_dataset_bases.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_dataset_cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_init_extensions.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_local_components.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_local_metric_tracker_callback.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_metric_pipeline.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_registry.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_samplers.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_scaffold_smoke.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_sweep_runner.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_sync_cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/tests/test_tracking_components.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/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.28
|
|
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/master/readme
|
|
@@ -76,14 +76,39 @@ across many experiment repositories. It is intended to be the public base
|
|
|
76
76
|
package, while optional integrations such as Azure are layered on through
|
|
77
77
|
extras and companion extension packages.
|
|
78
78
|
|
|
79
|
-
Current release: `deep-learning-core==0.0.
|
|
79
|
+
Current public release: `deep-learning-core==0.0.28`.
|
|
80
|
+
Current development version: `0.0.28`.
|
|
80
81
|
|
|
81
82
|
Compatible companion package floors:
|
|
82
83
|
|
|
83
84
|
- `deep-learning-azure>=0.0.18,<0.1`
|
|
84
85
|
- `deep-learning-mlflow>=0.0.11,<0.1`
|
|
86
|
+
- `deep-learning-robotics>=0.0.2,<0.1` with
|
|
87
|
+
`deep-learning-core>=0.0.28,<0.1`
|
|
85
88
|
- `deep-learning-wandb>=0.0.12,<0.1`
|
|
86
89
|
|
|
90
|
+
## What's New in 0.0.28?
|
|
91
|
+
|
|
92
|
+
- RL collection, replay insertion, episode persistence, environment creation,
|
|
93
|
+
and RL component scaffolding now keep one-off logic inline for a more direct
|
|
94
|
+
implementation
|
|
95
|
+
- public trainer, environment, episode-manager, and scaffold behavior remains
|
|
96
|
+
unchanged
|
|
97
|
+
|
|
98
|
+
## What's New in 0.0.27?
|
|
99
|
+
|
|
100
|
+
- episode managers provide generic RL summaries and selective, complete
|
|
101
|
+
trajectory capture alongside the existing metric-manager system
|
|
102
|
+
- scalar and same-step vector environments share one collector contract with
|
|
103
|
+
preserved terminal observations and per-lane episode identity
|
|
104
|
+
- Q-learning, DQN, PPO, and SAC now consume vector collection natively; neural
|
|
105
|
+
policies perform batched inference and replay/rollout storage preserves the
|
|
106
|
+
correct algorithm-specific scheduling and boundary semantics
|
|
107
|
+
- replay insertion and PPO rollout/GAE computation operate on real batches,
|
|
108
|
+
while scalar custom trainers remain compatible through the original hooks
|
|
109
|
+
- extension packages can import and register environments without depending on
|
|
110
|
+
dl-core import order
|
|
111
|
+
|
|
87
112
|
## What's New in 0.0.26?
|
|
88
113
|
|
|
89
114
|
- Gymnasium-compatible environments can now be registered, discovered, and
|
|
@@ -167,6 +192,9 @@ used by the validated Azure packaging stack. The MLflow extra pulls in
|
|
|
167
192
|
- `deep-learning-core[wandb]`: adds the public
|
|
168
193
|
[`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
169
194
|
package for Weights & Biases integration
|
|
195
|
+
- [`deep-learning-robotics`](https://github.com/Blazkowiz47/dl-robotics):
|
|
196
|
+
adds fast scalar and vector 2D MAPF environments, metrics, and episode media
|
|
197
|
+
as a separately installed companion package
|
|
170
198
|
|
|
171
199
|
The extension packages stay separate so the base package remains reusable and
|
|
172
200
|
vendor-neutral.
|
|
@@ -177,6 +205,7 @@ integration without using extras:
|
|
|
177
205
|
```bash
|
|
178
206
|
pip install deep-learning-azure
|
|
179
207
|
pip install deep-learning-mlflow
|
|
208
|
+
pip install deep-learning-robotics
|
|
180
209
|
pip install deep-learning-wandb
|
|
181
210
|
```
|
|
182
211
|
|
|
@@ -367,6 +396,7 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
367
396
|
|
|
368
397
|
- [`dl-azure`](https://github.com/Blazkowiz47/dl-azure)
|
|
369
398
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
399
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics)
|
|
370
400
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
371
401
|
|
|
372
402
|
## Scaffold Commands
|
|
@@ -386,6 +416,7 @@ uv run dl-core add trainer MyTrainer
|
|
|
386
416
|
uv run dl-core add trainer MyPolicy --base rltrainer
|
|
387
417
|
uv run dl-core add callback MyMetrics
|
|
388
418
|
uv run dl-core add metric_manager MyManager
|
|
419
|
+
uv run dl-core add episode_manager MyEpisodeManager
|
|
389
420
|
uv run dl-core add sampler MySampler
|
|
390
421
|
uv run dl-core add optimizer MyOptimizer
|
|
391
422
|
uv run dl-core add scheduler MyScheduler
|
|
@@ -7,14 +7,39 @@ across many experiment repositories. It is intended to be the public base
|
|
|
7
7
|
package, while optional integrations such as Azure are layered on through
|
|
8
8
|
extras and companion extension packages.
|
|
9
9
|
|
|
10
|
-
Current release: `deep-learning-core==0.0.
|
|
10
|
+
Current public release: `deep-learning-core==0.0.28`.
|
|
11
|
+
Current development version: `0.0.28`.
|
|
11
12
|
|
|
12
13
|
Compatible companion package floors:
|
|
13
14
|
|
|
14
15
|
- `deep-learning-azure>=0.0.18,<0.1`
|
|
15
16
|
- `deep-learning-mlflow>=0.0.11,<0.1`
|
|
17
|
+
- `deep-learning-robotics>=0.0.2,<0.1` with
|
|
18
|
+
`deep-learning-core>=0.0.28,<0.1`
|
|
16
19
|
- `deep-learning-wandb>=0.0.12,<0.1`
|
|
17
20
|
|
|
21
|
+
## What's New in 0.0.28?
|
|
22
|
+
|
|
23
|
+
- RL collection, replay insertion, episode persistence, environment creation,
|
|
24
|
+
and RL component scaffolding now keep one-off logic inline for a more direct
|
|
25
|
+
implementation
|
|
26
|
+
- public trainer, environment, episode-manager, and scaffold behavior remains
|
|
27
|
+
unchanged
|
|
28
|
+
|
|
29
|
+
## What's New in 0.0.27?
|
|
30
|
+
|
|
31
|
+
- episode managers provide generic RL summaries and selective, complete
|
|
32
|
+
trajectory capture alongside the existing metric-manager system
|
|
33
|
+
- scalar and same-step vector environments share one collector contract with
|
|
34
|
+
preserved terminal observations and per-lane episode identity
|
|
35
|
+
- Q-learning, DQN, PPO, and SAC now consume vector collection natively; neural
|
|
36
|
+
policies perform batched inference and replay/rollout storage preserves the
|
|
37
|
+
correct algorithm-specific scheduling and boundary semantics
|
|
38
|
+
- replay insertion and PPO rollout/GAE computation operate on real batches,
|
|
39
|
+
while scalar custom trainers remain compatible through the original hooks
|
|
40
|
+
- extension packages can import and register environments without depending on
|
|
41
|
+
dl-core import order
|
|
42
|
+
|
|
18
43
|
## What's New in 0.0.26?
|
|
19
44
|
|
|
20
45
|
- Gymnasium-compatible environments can now be registered, discovered, and
|
|
@@ -98,6 +123,9 @@ used by the validated Azure packaging stack. The MLflow extra pulls in
|
|
|
98
123
|
- `deep-learning-core[wandb]`: adds the public
|
|
99
124
|
[`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
100
125
|
package for Weights & Biases integration
|
|
126
|
+
- [`deep-learning-robotics`](https://github.com/Blazkowiz47/dl-robotics):
|
|
127
|
+
adds fast scalar and vector 2D MAPF environments, metrics, and episode media
|
|
128
|
+
as a separately installed companion package
|
|
101
129
|
|
|
102
130
|
The extension packages stay separate so the base package remains reusable and
|
|
103
131
|
vendor-neutral.
|
|
@@ -108,6 +136,7 @@ integration without using extras:
|
|
|
108
136
|
```bash
|
|
109
137
|
pip install deep-learning-azure
|
|
110
138
|
pip install deep-learning-mlflow
|
|
139
|
+
pip install deep-learning-robotics
|
|
111
140
|
pip install deep-learning-wandb
|
|
112
141
|
```
|
|
113
142
|
|
|
@@ -298,6 +327,7 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
298
327
|
|
|
299
328
|
- [`dl-azure`](https://github.com/Blazkowiz47/dl-azure)
|
|
300
329
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
330
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics)
|
|
301
331
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
302
332
|
|
|
303
333
|
## Scaffold Commands
|
|
@@ -317,6 +347,7 @@ uv run dl-core add trainer MyTrainer
|
|
|
317
347
|
uv run dl-core add trainer MyPolicy --base rltrainer
|
|
318
348
|
uv run dl-core add callback MyMetrics
|
|
319
349
|
uv run dl-core add metric_manager MyManager
|
|
350
|
+
uv run dl-core add episode_manager MyEpisodeManager
|
|
320
351
|
uv run dl-core add sampler MySampler
|
|
321
352
|
uv run dl-core add optimizer MyOptimizer
|
|
322
353
|
uv run dl-core add scheduler MyScheduler
|
|
@@ -4,7 +4,14 @@ This documentation is split into quick references, workflow guides, and
|
|
|
4
4
|
technical notes. The goal is the same as in the original framework repo, but
|
|
5
5
|
focused on the extracted package and the experiment-repo workflow around it.
|
|
6
6
|
|
|
7
|
-
Current public release: `deep-learning-core==0.0.
|
|
7
|
+
Current public release: `deep-learning-core==0.0.28`.
|
|
8
|
+
Current development version: `0.0.28`.
|
|
9
|
+
|
|
10
|
+
## What's New in 0.0.28?
|
|
11
|
+
|
|
12
|
+
- RL collection, replay insertion, episode persistence, environment creation,
|
|
13
|
+
and component scaffolding use fewer one-off implementation helpers
|
|
14
|
+
- public APIs and runtime behavior remain unchanged
|
|
8
15
|
|
|
9
16
|
## Companion Packages
|
|
10
17
|
|
|
@@ -12,6 +19,8 @@ Current public release: `deep-learning-core==0.0.26`.
|
|
|
12
19
|
Azure dataset foundations
|
|
13
20
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow): local MLflow
|
|
14
21
|
integration
|
|
22
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics): fast 2D MAPF
|
|
23
|
+
environments, episode metrics, and GIF/MP4 artifacts
|
|
15
24
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb): Weights & Biases
|
|
16
25
|
integration
|
|
17
26
|
|
{deep_learning_core-0.0.26 → deep_learning_core-0.0.28}/readme/technical/6_reinforcement_learning.md
RENAMED
|
@@ -105,11 +105,96 @@ simulator state is not serialized; a resumed run begins at a new episode
|
|
|
105
105
|
boundary. A checkpoint is rejected when its trainer implementation or component
|
|
106
106
|
names do not match the configured trainer.
|
|
107
107
|
|
|
108
|
+
Training collection can use a Gymnasium vector environment. The built-in
|
|
109
|
+
adapter creates one with same-step autoreset so completed transitions retain
|
|
110
|
+
their real `final_obs` while collection immediately receives the next episode's
|
|
111
|
+
initial observation:
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
environment:
|
|
115
|
+
name: gymnasium_vector
|
|
116
|
+
id: CartPole-v1
|
|
117
|
+
num_envs: 8
|
|
118
|
+
vectorization_mode: sync
|
|
119
|
+
|
|
120
|
+
evaluation_environment:
|
|
121
|
+
name: gymnasium
|
|
122
|
+
id: CartPole-v1
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`global_step` counts transitions, while `collector_step` counts vector
|
|
126
|
+
environment calls. `select_actions` and `process_transition_batch` expose one
|
|
127
|
+
whole collector step to vector-aware algorithms. Existing custom trainers that
|
|
128
|
+
only implement `select_action` and `process_transition` remain compatible
|
|
129
|
+
through stable environment-index dispatch. Evaluation deliberately uses one
|
|
130
|
+
scalar environment so videos and deterministic episode artifacts have
|
|
131
|
+
unambiguous identity. A transition budget can overshoot by at most
|
|
132
|
+
`num_envs - 1` because a vector step is atomic. An episode budget has the same
|
|
133
|
+
maximum overshoot when several lanes complete in one vector step.
|
|
134
|
+
|
|
135
|
+
Tabular Q-learning consumes vector steps in stable lane order. DQN performs at
|
|
136
|
+
most one batched action-selection inference per vector step, inserts the complete
|
|
137
|
+
transition batch into replay, and applies every update or target-sync boundary
|
|
138
|
+
crossed by that atomic step in schedule order. PPO performs batched policy and
|
|
139
|
+
next-value inference, stores independent `[time, environment]` streams, and
|
|
140
|
+
flattens them only after per-lane GAE is complete. `rollout_steps` counts
|
|
141
|
+
synchronized collector calls, so an update uses
|
|
142
|
+
`rollout_steps * num_envs` samples. SAC samples continuous actions in one actor
|
|
143
|
+
call, inserts vector transitions directly into replay, and runs the gradient
|
|
144
|
+
work for every update-frequency boundary crossed by the atomic vector step.
|
|
145
|
+
Each crossed boundary emits its own update log, and warm-up is applied to the
|
|
146
|
+
first `learning_starts` transitions even when that boundary falls inside a
|
|
147
|
+
vector step.
|
|
148
|
+
|
|
149
|
+
Replay storage accepts transition batches directly and preserves configured
|
|
150
|
+
observation/action dtypes. PPO rollout storage is preallocated as
|
|
151
|
+
`[time, environment, ...]`; generalized advantages are propagated only within
|
|
152
|
+
the same environment stream before the rollout is flattened for minibatches.
|
|
153
|
+
|
|
108
154
|
RL callbacks can implement `on_episode_start`, `on_episode_end`,
|
|
109
155
|
`on_update_end`, and `on_evaluation_end`. The existing run-level
|
|
110
156
|
`on_training_start`, `on_training_end`, and `on_training_finalized` hooks remain
|
|
111
157
|
shared with epoch training.
|
|
112
158
|
|
|
159
|
+
## Episode Managers
|
|
160
|
+
|
|
161
|
+
Episode managers are the reinforcement-learning counterpart to the metric
|
|
162
|
+
managers used by `EpochTrainer`. They accumulate environment transitions,
|
|
163
|
+
compute episode summaries, and optionally persist complete trajectories while
|
|
164
|
+
callbacks remain responsible for external logging and side effects.
|
|
165
|
+
|
|
166
|
+
The built-in `standard` manager always computes return, length, reward
|
|
167
|
+
statistics, termination, truncation, and success when the environment exposes
|
|
168
|
+
`is_success`. Complete trajectories preserve the initial observation followed
|
|
169
|
+
by one observation per transition, so an episode of length `T` contains `T + 1`
|
|
170
|
+
observations and `T` actions, rewards, termination flags, and truncation flags.
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
episode_managers:
|
|
174
|
+
standard:
|
|
175
|
+
capture_phases: [evaluation]
|
|
176
|
+
capture_every_n_episodes: 10
|
|
177
|
+
max_captured_episodes: 20
|
|
178
|
+
info_keys: [is_success, collision]
|
|
179
|
+
capture_action_info: false
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Captured array-valued trajectories are portable compressed NumPy archives under
|
|
183
|
+
`final/episodes/<phase>/`; the episode index and scalar summary streams remain
|
|
184
|
+
JSONL. Array dtypes are preserved and arbitrary Python objects are not pickled.
|
|
185
|
+
Environments with array-valued observations and actions, including nested
|
|
186
|
+
dictionaries and tuples, can persist their environment-boundary trajectory.
|
|
187
|
+
Exact hidden simulator state is available only when a concrete environment
|
|
188
|
+
provides a separate state snapshot capability.
|
|
189
|
+
|
|
190
|
+
Episode managers use the normal component workflow:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
dl-core list episode_manager
|
|
194
|
+
dl-core describe episode_manager standard
|
|
195
|
+
dl-core add episode_manager PathAnalysis
|
|
196
|
+
```
|
|
197
|
+
|
|
113
198
|
The built-in local metric tracker and the MLflow and W&B companion callbacks
|
|
114
199
|
record episode, algorithm-update, and evaluation metrics as well as supervised
|
|
115
200
|
epoch metrics. Training-episode series stay separate from the aggregate metrics
|
|
@@ -263,10 +348,18 @@ or continuous `mean` and `log_std` tensors shaped `[batch, action_dimensions]`.
|
|
|
263
348
|
Policy modules should avoid dropout and other stochastic training-mode layers,
|
|
264
349
|
because PPO must reproduce the behavior-policy probability for stored actions.
|
|
265
350
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
351
|
+
PPO accepts scalar or vector training environments. Vector collection evaluates
|
|
352
|
+
all lanes in one policy call, computes GAE independently along each environment
|
|
353
|
+
stream, and flattens the time/environment axes only for minibatch optimization.
|
|
354
|
+
`rollout_steps` counts synchronized collector steps, so a full vector rollout
|
|
355
|
+
contains `rollout_steps * num_envs` training samples. Evaluation remains scalar
|
|
356
|
+
to preserve deterministic episode-level reporting.
|
|
357
|
+
|
|
358
|
+
Partial rollouts are stored in checkpoints. Because environment state is not
|
|
359
|
+
part of an RL checkpoint, resuming marks the final stored transition in every
|
|
360
|
+
unfinished lane as truncated. Its one-step value target is retained, while GAE
|
|
361
|
+
cannot propagate from the newly reset environment into the earlier rollout
|
|
362
|
+
fragment.
|
|
270
363
|
|
|
271
364
|
## Soft Actor-Critic
|
|
272
365
|
|
|
@@ -22,6 +22,7 @@ _BUILTIN_COMPONENT_MODULES = (
|
|
|
22
22
|
"datasets",
|
|
23
23
|
"environments",
|
|
24
24
|
"executors",
|
|
25
|
+
"episode_managers",
|
|
25
26
|
"metrics_sources",
|
|
26
27
|
"metric_managers",
|
|
27
28
|
"metrics",
|
|
@@ -33,7 +34,7 @@ _BUILTIN_COMPONENT_MODULES = (
|
|
|
33
34
|
"trainers",
|
|
34
35
|
)
|
|
35
36
|
|
|
36
|
-
__version__ = "0.0.
|
|
37
|
+
__version__ = "0.0.28"
|
|
37
38
|
|
|
38
39
|
_LOCAL_MODULES: dict[str, ModuleType] = {}
|
|
39
40
|
_LOCAL_REGISTRATIONS: list[tuple[Any, str, type[Any]]] = []
|
|
@@ -17,6 +17,7 @@ from dl_core.core import (
|
|
|
17
17
|
CALLBACK_REGISTRY,
|
|
18
18
|
CRITERION_REGISTRY,
|
|
19
19
|
DATASET_REGISTRY,
|
|
20
|
+
EPISODE_MANAGER_REGISTRY,
|
|
20
21
|
ENVIRONMENT_REGISTRY,
|
|
21
22
|
EXECUTOR_REGISTRY,
|
|
22
23
|
FACE_DETECTOR_REGISTRY,
|
|
@@ -39,6 +40,7 @@ _COMPONENT_REGISTRIES: dict[str, ComponentRegistry] = {
|
|
|
39
40
|
"callback": CALLBACK_REGISTRY,
|
|
40
41
|
"criterion": CRITERION_REGISTRY,
|
|
41
42
|
"dataset": DATASET_REGISTRY,
|
|
43
|
+
"episode_manager": EPISODE_MANAGER_REGISTRY,
|
|
42
44
|
"environment": ENVIRONMENT_REGISTRY,
|
|
43
45
|
"executor": EXECUTOR_REGISTRY,
|
|
44
46
|
"face_detector": FACE_DETECTOR_REGISTRY,
|
|
@@ -67,6 +69,10 @@ _DESCRIBE_TYPE_ALIASES = {
|
|
|
67
69
|
"criterions": "criterion",
|
|
68
70
|
"dataset": "dataset",
|
|
69
71
|
"datasets": "dataset",
|
|
72
|
+
"episode_manager": "episode_manager",
|
|
73
|
+
"episode_managers": "episode_manager",
|
|
74
|
+
"episodemanager": "episode_manager",
|
|
75
|
+
"episodemanagers": "episode_manager",
|
|
70
76
|
"environment": "environment",
|
|
71
77
|
"environments": "environment",
|
|
72
78
|
"executor": "executor",
|
|
@@ -478,6 +484,8 @@ def _build_config_example(
|
|
|
478
484
|
payload = {"criterions": {component_name: field_values}}
|
|
479
485
|
elif component_type == "metric_manager":
|
|
480
486
|
payload = {"metric_managers": {component_name: field_values}}
|
|
487
|
+
elif component_type == "episode_manager":
|
|
488
|
+
payload = {"episode_managers": {component_name: field_values}}
|
|
481
489
|
elif component_type == "callback":
|
|
482
490
|
payload = {"callbacks": {component_name: field_values}}
|
|
483
491
|
elif component_type == "optimizer":
|
|
@@ -15,6 +15,7 @@ from dl_core.core import (
|
|
|
15
15
|
AUGMENTATION_REGISTRY,
|
|
16
16
|
CALLBACK_REGISTRY,
|
|
17
17
|
CRITERION_REGISTRY,
|
|
18
|
+
EPISODE_MANAGER_REGISTRY,
|
|
18
19
|
EXECUTOR_REGISTRY,
|
|
19
20
|
METRIC_MANAGER_REGISTRY,
|
|
20
21
|
METRIC_REGISTRY,
|
|
@@ -97,6 +98,13 @@ _COMPONENT_SPECS = {
|
|
|
97
98
|
init_docstring="Local executor extensions.",
|
|
98
99
|
register_name="register_executor",
|
|
99
100
|
),
|
|
101
|
+
"episode_manager": ComponentSpec(
|
|
102
|
+
canonical_name="episode_manager",
|
|
103
|
+
package_dir="episode_managers",
|
|
104
|
+
class_suffix="EpisodeManager",
|
|
105
|
+
init_docstring="Local reinforcement-learning episode managers.",
|
|
106
|
+
register_name="register_episode_manager",
|
|
107
|
+
),
|
|
100
108
|
"metric": ComponentSpec(
|
|
101
109
|
canonical_name="metric",
|
|
102
110
|
package_dir="metrics",
|
|
@@ -153,6 +161,7 @@ _COMPONENT_BASE_REGISTRIES: dict[str, ComponentRegistry] = {
|
|
|
153
161
|
"callback": CALLBACK_REGISTRY,
|
|
154
162
|
"criterion": CRITERION_REGISTRY,
|
|
155
163
|
"executor": EXECUTOR_REGISTRY,
|
|
164
|
+
"episode_manager": EPISODE_MANAGER_REGISTRY,
|
|
156
165
|
"metric": METRIC_REGISTRY,
|
|
157
166
|
"metric_manager": METRIC_MANAGER_REGISTRY,
|
|
158
167
|
"model": MODEL_REGISTRY,
|
|
@@ -187,6 +196,14 @@ _DEFAULT_COMPONENT_BASE_SPECS = {
|
|
|
187
196
|
base_class="BaseExecutor",
|
|
188
197
|
class_docstring="Local executor scaffold based on BaseExecutor.",
|
|
189
198
|
),
|
|
199
|
+
"episode_manager": ComponentBaseSpec(
|
|
200
|
+
canonical_name="episode_manager",
|
|
201
|
+
import_path="dl_core.core",
|
|
202
|
+
base_class="BaseEpisodeManager",
|
|
203
|
+
class_docstring=(
|
|
204
|
+
"Local episode manager scaffold based on BaseEpisodeManager."
|
|
205
|
+
),
|
|
206
|
+
),
|
|
190
207
|
"metric": ComponentBaseSpec(
|
|
191
208
|
canonical_name="metric",
|
|
192
209
|
import_path="dl_core.core",
|
|
@@ -244,6 +261,10 @@ _COMPONENT_TYPE_ALIASES = {
|
|
|
244
261
|
"datasets": "dataset",
|
|
245
262
|
"executor": "executor",
|
|
246
263
|
"executors": "executor",
|
|
264
|
+
"episode_manager": "episode_manager",
|
|
265
|
+
"episode_managers": "episode_manager",
|
|
266
|
+
"episodemanager": "episode_manager",
|
|
267
|
+
"episodemanagers": "episode_manager",
|
|
247
268
|
"metric": "metric",
|
|
248
269
|
"metrics": "metric",
|
|
249
270
|
"metricmanager": "metric_manager",
|
|
@@ -608,6 +629,33 @@ def _render_component(
|
|
|
608
629
|
base_class=metric_manager_base.base_class,
|
|
609
630
|
class_docstring=metric_manager_base.class_docstring,
|
|
610
631
|
)
|
|
632
|
+
if spec.canonical_name == "episode_manager":
|
|
633
|
+
episode_manager_base = _component_base_required(component_base)
|
|
634
|
+
if _is_default_component_base(spec.canonical_name, episode_manager_base):
|
|
635
|
+
return f'''"""Local episode manager scaffold."""
|
|
636
|
+
|
|
637
|
+
from __future__ import annotations
|
|
638
|
+
|
|
639
|
+
from dl_core.core import EpisodeRecord, EpisodeResult, register_episode_manager
|
|
640
|
+
from {episode_manager_base.import_path} import {episode_manager_base.base_class}
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
@register_episode_manager({registry_literal})
|
|
644
|
+
class {class_name}({episode_manager_base.base_class}):
|
|
645
|
+
"""{episode_manager_base.class_docstring}"""
|
|
646
|
+
|
|
647
|
+
def summarize_episode(
|
|
648
|
+
self,
|
|
649
|
+
record: EpisodeRecord,
|
|
650
|
+
result: EpisodeResult,
|
|
651
|
+
**statistics: float | int,
|
|
652
|
+
) -> dict[str, float]:
|
|
653
|
+
"""Compute scalar metrics for one completed episode."""
|
|
654
|
+
return {{
|
|
655
|
+
"episode/return": float(statistics["episode_return"]),
|
|
656
|
+
"episode/length": float(statistics["length"]),
|
|
657
|
+
}}
|
|
658
|
+
'''
|
|
611
659
|
if spec.canonical_name == "model":
|
|
612
660
|
model_base = _component_base_required(component_base)
|
|
613
661
|
if _is_default_component_base(spec.canonical_name, model_base):
|
|
@@ -1036,33 +1084,7 @@ def _trainer_component(
|
|
|
1036
1084
|
class_docstring=class_docstring,
|
|
1037
1085
|
)
|
|
1038
1086
|
if base_class == "RLTrainer":
|
|
1039
|
-
return
|
|
1040
|
-
registry_literal=registry_literal,
|
|
1041
|
-
class_name=class_name,
|
|
1042
|
-
import_path=import_path,
|
|
1043
|
-
base_class=base_class,
|
|
1044
|
-
class_docstring=class_docstring,
|
|
1045
|
-
)
|
|
1046
|
-
return _epoch_trainer_component(
|
|
1047
|
-
registry_literal=registry_literal,
|
|
1048
|
-
class_name=class_name,
|
|
1049
|
-
import_path=import_path,
|
|
1050
|
-
base_class=base_class,
|
|
1051
|
-
class_docstring=class_docstring,
|
|
1052
|
-
)
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
def _rl_trainer_component(
|
|
1056
|
-
*,
|
|
1057
|
-
registry_literal: str,
|
|
1058
|
-
class_name: str,
|
|
1059
|
-
import_path: str,
|
|
1060
|
-
base_class: str,
|
|
1061
|
-
class_docstring: str,
|
|
1062
|
-
) -> str:
|
|
1063
|
-
"""Render an episode-oriented reinforcement-learning trainer scaffold."""
|
|
1064
|
-
|
|
1065
|
-
return f'''"""Local reinforcement-learning trainer scaffold."""
|
|
1087
|
+
return f'''"""Local reinforcement-learning trainer scaffold."""
|
|
1066
1088
|
|
|
1067
1089
|
from __future__ import annotations
|
|
1068
1090
|
|
|
@@ -1105,6 +1127,13 @@ class {class_name}({base_class}):
|
|
|
1105
1127
|
if state:
|
|
1106
1128
|
raise ValueError("TODO: validate and restore algorithm state.")
|
|
1107
1129
|
'''
|
|
1130
|
+
return _epoch_trainer_component(
|
|
1131
|
+
registry_literal=registry_literal,
|
|
1132
|
+
class_name=class_name,
|
|
1133
|
+
import_path=import_path,
|
|
1134
|
+
base_class=base_class,
|
|
1135
|
+
class_docstring=class_docstring,
|
|
1136
|
+
)
|
|
1108
1137
|
|
|
1109
1138
|
|
|
1110
1139
|
def _epoch_trainer_component(
|
|
@@ -16,6 +16,7 @@ from .base_executor import BaseExecutor
|
|
|
16
16
|
from .base_metric import BaseMetric
|
|
17
17
|
from .base_metrics_source import BaseMetricsSource
|
|
18
18
|
from .base_metric_manager import BaseMetricManager
|
|
19
|
+
from .base_episode_manager import BaseEpisodeManager
|
|
19
20
|
from .base_biometric_model import BaseBiometricModel
|
|
20
21
|
from .base_model import BaseModel
|
|
21
22
|
from .base_sampler import BaseSampler
|
|
@@ -26,12 +27,23 @@ from .adaptive_computation_trainer import (
|
|
|
26
27
|
CarryState,
|
|
27
28
|
)
|
|
28
29
|
from .base_callback import Callback
|
|
30
|
+
from .batched_environment import BatchedEnvironment
|
|
29
31
|
from .base_trainer import BaseTrainer
|
|
30
32
|
from .epoch_trainer import EpochTrainer
|
|
31
33
|
from .sequence_trainer import SequenceStepOutput, SequenceTrainer
|
|
32
34
|
from .base_transform import BaseTransform
|
|
33
35
|
from .rl_trainer import RLTrainer
|
|
34
|
-
from .rl_types import
|
|
36
|
+
from .rl_types import (
|
|
37
|
+
ActionOutput,
|
|
38
|
+
BatchActionOutput,
|
|
39
|
+
Environment,
|
|
40
|
+
EpisodeContext,
|
|
41
|
+
EpisodeRecord,
|
|
42
|
+
EpisodeResult,
|
|
43
|
+
Transition,
|
|
44
|
+
TransitionBatch,
|
|
45
|
+
VectorEnvironment,
|
|
46
|
+
)
|
|
35
47
|
from .replay_buffer import ReplayBatch, ReplayBuffer
|
|
36
48
|
from .rollout_buffer import RolloutBatch, RolloutBuffer
|
|
37
49
|
from .config_metadata import ConfigFieldSpec, config_field
|
|
@@ -44,6 +56,7 @@ from .registry import (
|
|
|
44
56
|
CRITERION_REGISTRY,
|
|
45
57
|
DATASET_REGISTRY,
|
|
46
58
|
ENVIRONMENT_REGISTRY,
|
|
59
|
+
EPISODE_MANAGER_REGISTRY,
|
|
47
60
|
EXECUTOR_REGISTRY,
|
|
48
61
|
FACE_DETECTOR_REGISTRY,
|
|
49
62
|
METRIC_MANAGER_REGISTRY,
|
|
@@ -65,6 +78,7 @@ from .registry import (
|
|
|
65
78
|
register_criterion,
|
|
66
79
|
register_dataset,
|
|
67
80
|
register_environment,
|
|
81
|
+
register_episode_manager,
|
|
68
82
|
register_executor,
|
|
69
83
|
register_face_detector,
|
|
70
84
|
register_metric,
|
|
@@ -94,8 +108,10 @@ __all__ = [
|
|
|
94
108
|
"BaseTracker",
|
|
95
109
|
"BaseMetricsSource",
|
|
96
110
|
"BaseMetricManager",
|
|
111
|
+
"BaseEpisodeManager",
|
|
97
112
|
"BaseSampler",
|
|
98
113
|
"Callback",
|
|
114
|
+
"BatchedEnvironment",
|
|
99
115
|
"BaseTrainer",
|
|
100
116
|
"EpochTrainer",
|
|
101
117
|
"SequenceTrainer",
|
|
@@ -109,8 +125,13 @@ __all__ = [
|
|
|
109
125
|
"LandmarkDetection",
|
|
110
126
|
"ConfigFieldSpec",
|
|
111
127
|
"Environment",
|
|
128
|
+
"VectorEnvironment",
|
|
112
129
|
"ActionOutput",
|
|
130
|
+
"BatchActionOutput",
|
|
113
131
|
"Transition",
|
|
132
|
+
"TransitionBatch",
|
|
133
|
+
"EpisodeContext",
|
|
134
|
+
"EpisodeRecord",
|
|
114
135
|
"EpisodeResult",
|
|
115
136
|
"RLTrainer",
|
|
116
137
|
"ReplayBatch",
|
|
@@ -123,6 +144,7 @@ __all__ = [
|
|
|
123
144
|
"TRAINER_REGISTRY",
|
|
124
145
|
"DATASET_REGISTRY",
|
|
125
146
|
"ENVIRONMENT_REGISTRY",
|
|
147
|
+
"EPISODE_MANAGER_REGISTRY",
|
|
126
148
|
"CRITERION_REGISTRY",
|
|
127
149
|
"METRIC_REGISTRY",
|
|
128
150
|
"METRIC_MANAGER_REGISTRY",
|
|
@@ -141,6 +163,7 @@ __all__ = [
|
|
|
141
163
|
"register_trainer",
|
|
142
164
|
"register_dataset",
|
|
143
165
|
"register_environment",
|
|
166
|
+
"register_episode_manager",
|
|
144
167
|
"register_face_detector",
|
|
145
168
|
"register_criterion",
|
|
146
169
|
"register_metric",
|