deep-learning-core 0.0.26__tar.gz → 0.0.27__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.27}/PKG-INFO +25 -2
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/README.md +24 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/pyproject.toml +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/README.md +3 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/6_reinforcement_learning.md +97 -4
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/__init__.py +2 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/component_describer.py +8 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/component_scaffold.py +66 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/__init__.py +24 -1
- deep_learning_core-0.0.27/src/dl_core/core/base_episode_manager.py +447 -0
- deep_learning_core-0.0.27/src/dl_core/core/batched_environment.py +266 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/registry.py +8 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/replay_buffer.py +91 -15
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/rl_trainer.py +524 -30
- deep_learning_core-0.0.27/src/dl_core/core/rl_types.py +205 -0
- deep_learning_core-0.0.27/src/dl_core/core/rollout_buffer.py +418 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/environments/__init__.py +13 -4
- deep_learning_core-0.0.27/src/dl_core/environments/gymnasium_vector_environment.py +38 -0
- deep_learning_core-0.0.27/src/dl_core/episode_managers/__init__.py +6 -0
- deep_learning_core-0.0.27/src/dl_core/episode_managers/standard.py +52 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/init_experiment.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/project.py +1 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/dqn_trainer.py +198 -80
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/ppo_trainer.py +200 -58
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/q_learning_trainer.py +81 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/sac_trainer.py +165 -46
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_component_describer.py +18 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_component_scaffold.py +37 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_dqn_trainer.py +165 -2
- deep_learning_core-0.0.27/tests/test_episode_manager.py +278 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_init_experiment.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_ppo_trainer.py +201 -2
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_q_learning_trainer.py +32 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_rl_environment_contracts.py +69 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_rl_preflight.py +1 -1
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_rl_trainer.py +47 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_sac_trainer.py +88 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/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.27}/.github/workflows/ci.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/.github/workflows/publish-testpypi.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/.github/workflows/publish.yml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/.gitignore +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/AGENTS.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/LICENSE +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/plan.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/guide/1_getting_started.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/guide/2_creating_an_experiment_repository.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/guide/3_local_components_and_sweeps.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/1_configuration.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/2_entry_points.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/3_sweep_system.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/4_local_component_loading.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/technical/5_testing.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/tldr/1_install_and_verify.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/readme/tldr/2_create_and_run_an_experiment.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/accelerators/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/accelerators/cpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/accelerators/multi_gpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/accelerators/single_gpu.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/analysis/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/analysis/sweep_analyzer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/augmentations/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/augmentations/minimal.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/augmentations/standard.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/checkpoint.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/dataset_refresh.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/early_stopping.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/local_metric_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/callbacks/metric_logger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/adaptive_computation_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_accelerator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_biometric_model.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_callback.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_criterion.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_dataset.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_detector.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_executor.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_metric.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_metric_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_metrics_source.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_model.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_sampler.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/base_transform.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/config_metadata.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/epoch_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/core/sequence_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/criterions/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/criterions/bce_with_logits.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/criterions/crossentropy.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/dataset_inspect.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/datasets/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/datasets/standard.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/environments/gymnasium_environment.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/executors/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/executors/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/init_extensions.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metric_managers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metric_managers/standard_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics/accuracy.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics/auc.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics/f1.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics/halt_steps.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics_sources/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/metrics_sources/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/migrate.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/models/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/models/dqn.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/models/ppo.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/models/resnet.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/models/sac.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/optimizers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/py.typed +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/samplers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/samplers/label.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/schedulers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/schedulers/cosinewithwarmup.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/single_run.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/smoke.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/config/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/config/config_builder.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/config/config_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/runner.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/template/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/template/template_loader.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/template/template_merger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/template/template_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep/template/tracking_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sweep_scaffold.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/sync.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/templates/README.md +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/templates/base/base.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/templates/base/base_sweep.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/templates/presets.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/templates/sweeps/example_sweep.yaml +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trackers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trackers/local.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/trainers/standard_trainer.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/artifact_manager.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/common.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/config.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/config_names.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/config_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/distributed_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/ema.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/logging/__init__.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/logging/logger.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/runtime_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/utils/sweep_tracker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/src/dl_core/worker.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/conftest.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_checkpoint_behavior.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_checkpoint_utils.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_config_validator.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_dataset_bases.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_dataset_cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_init_extensions.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_local_components.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_local_metric_tracker_callback.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_metric_pipeline.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_registry.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_samplers.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_scaffold_smoke.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_sweep_runner.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_sync_cli.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/tests/test_tracking_components.py +0 -0
- {deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/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.27
|
|
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,31 @@ 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.26`.
|
|
79
|
+
Current public release: `deep-learning-core==0.0.26`.
|
|
80
|
+
Current development version: `0.0.27`.
|
|
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.1,<0.1` with
|
|
87
|
+
`deep-learning-core>=0.0.27,<0.1`
|
|
85
88
|
- `deep-learning-wandb>=0.0.12,<0.1`
|
|
86
89
|
|
|
90
|
+
## Unreleased: 0.0.27
|
|
91
|
+
|
|
92
|
+
- episode managers provide generic RL summaries and selective, complete
|
|
93
|
+
trajectory capture alongside the existing metric-manager system
|
|
94
|
+
- scalar and same-step vector environments share one collector contract with
|
|
95
|
+
preserved terminal observations and per-lane episode identity
|
|
96
|
+
- Q-learning, DQN, PPO, and SAC now consume vector collection natively; neural
|
|
97
|
+
policies perform batched inference and replay/rollout storage preserves the
|
|
98
|
+
correct algorithm-specific scheduling and boundary semantics
|
|
99
|
+
- replay insertion and PPO rollout/GAE computation operate on real batches,
|
|
100
|
+
while scalar custom trainers remain compatible through the original hooks
|
|
101
|
+
- extension packages can import and register environments without depending on
|
|
102
|
+
dl-core import order
|
|
103
|
+
|
|
87
104
|
## What's New in 0.0.26?
|
|
88
105
|
|
|
89
106
|
- Gymnasium-compatible environments can now be registered, discovered, and
|
|
@@ -167,6 +184,9 @@ used by the validated Azure packaging stack. The MLflow extra pulls in
|
|
|
167
184
|
- `deep-learning-core[wandb]`: adds the public
|
|
168
185
|
[`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
169
186
|
package for Weights & Biases integration
|
|
187
|
+
- [`deep-learning-robotics`](https://github.com/Blazkowiz47/dl-robotics):
|
|
188
|
+
adds fast scalar and vector 2D MAPF environments, metrics, and episode media
|
|
189
|
+
as a separately installed companion package
|
|
170
190
|
|
|
171
191
|
The extension packages stay separate so the base package remains reusable and
|
|
172
192
|
vendor-neutral.
|
|
@@ -177,6 +197,7 @@ integration without using extras:
|
|
|
177
197
|
```bash
|
|
178
198
|
pip install deep-learning-azure
|
|
179
199
|
pip install deep-learning-mlflow
|
|
200
|
+
pip install deep-learning-robotics
|
|
180
201
|
pip install deep-learning-wandb
|
|
181
202
|
```
|
|
182
203
|
|
|
@@ -367,6 +388,7 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
367
388
|
|
|
368
389
|
- [`dl-azure`](https://github.com/Blazkowiz47/dl-azure)
|
|
369
390
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
391
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics)
|
|
370
392
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
371
393
|
|
|
372
394
|
## Scaffold Commands
|
|
@@ -386,6 +408,7 @@ uv run dl-core add trainer MyTrainer
|
|
|
386
408
|
uv run dl-core add trainer MyPolicy --base rltrainer
|
|
387
409
|
uv run dl-core add callback MyMetrics
|
|
388
410
|
uv run dl-core add metric_manager MyManager
|
|
411
|
+
uv run dl-core add episode_manager MyEpisodeManager
|
|
389
412
|
uv run dl-core add sampler MySampler
|
|
390
413
|
uv run dl-core add optimizer MyOptimizer
|
|
391
414
|
uv run dl-core add scheduler MyScheduler
|
|
@@ -7,14 +7,31 @@ 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.26`.
|
|
10
|
+
Current public release: `deep-learning-core==0.0.26`.
|
|
11
|
+
Current development version: `0.0.27`.
|
|
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.1,<0.1` with
|
|
18
|
+
`deep-learning-core>=0.0.27,<0.1`
|
|
16
19
|
- `deep-learning-wandb>=0.0.12,<0.1`
|
|
17
20
|
|
|
21
|
+
## Unreleased: 0.0.27
|
|
22
|
+
|
|
23
|
+
- episode managers provide generic RL summaries and selective, complete
|
|
24
|
+
trajectory capture alongside the existing metric-manager system
|
|
25
|
+
- scalar and same-step vector environments share one collector contract with
|
|
26
|
+
preserved terminal observations and per-lane episode identity
|
|
27
|
+
- Q-learning, DQN, PPO, and SAC now consume vector collection natively; neural
|
|
28
|
+
policies perform batched inference and replay/rollout storage preserves the
|
|
29
|
+
correct algorithm-specific scheduling and boundary semantics
|
|
30
|
+
- replay insertion and PPO rollout/GAE computation operate on real batches,
|
|
31
|
+
while scalar custom trainers remain compatible through the original hooks
|
|
32
|
+
- extension packages can import and register environments without depending on
|
|
33
|
+
dl-core import order
|
|
34
|
+
|
|
18
35
|
## What's New in 0.0.26?
|
|
19
36
|
|
|
20
37
|
- Gymnasium-compatible environments can now be registered, discovered, and
|
|
@@ -98,6 +115,9 @@ used by the validated Azure packaging stack. The MLflow extra pulls in
|
|
|
98
115
|
- `deep-learning-core[wandb]`: adds the public
|
|
99
116
|
[`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
100
117
|
package for Weights & Biases integration
|
|
118
|
+
- [`deep-learning-robotics`](https://github.com/Blazkowiz47/dl-robotics):
|
|
119
|
+
adds fast scalar and vector 2D MAPF environments, metrics, and episode media
|
|
120
|
+
as a separately installed companion package
|
|
101
121
|
|
|
102
122
|
The extension packages stay separate so the base package remains reusable and
|
|
103
123
|
vendor-neutral.
|
|
@@ -108,6 +128,7 @@ integration without using extras:
|
|
|
108
128
|
```bash
|
|
109
129
|
pip install deep-learning-azure
|
|
110
130
|
pip install deep-learning-mlflow
|
|
131
|
+
pip install deep-learning-robotics
|
|
111
132
|
pip install deep-learning-wandb
|
|
112
133
|
```
|
|
113
134
|
|
|
@@ -298,6 +319,7 @@ scaffold a `wandb` callback block, W&B tracking defaults, and `.env.example`.
|
|
|
298
319
|
|
|
299
320
|
- [`dl-azure`](https://github.com/Blazkowiz47/dl-azure)
|
|
300
321
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow)
|
|
322
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics)
|
|
301
323
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb)
|
|
302
324
|
|
|
303
325
|
## Scaffold Commands
|
|
@@ -317,6 +339,7 @@ uv run dl-core add trainer MyTrainer
|
|
|
317
339
|
uv run dl-core add trainer MyPolicy --base rltrainer
|
|
318
340
|
uv run dl-core add callback MyMetrics
|
|
319
341
|
uv run dl-core add metric_manager MyManager
|
|
342
|
+
uv run dl-core add episode_manager MyEpisodeManager
|
|
320
343
|
uv run dl-core add sampler MySampler
|
|
321
344
|
uv run dl-core add optimizer MyOptimizer
|
|
322
345
|
uv run dl-core add scheduler MyScheduler
|
|
@@ -5,6 +5,7 @@ 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
7
|
Current public release: `deep-learning-core==0.0.26`.
|
|
8
|
+
Current development version: `0.0.27`.
|
|
8
9
|
|
|
9
10
|
## Companion Packages
|
|
10
11
|
|
|
@@ -12,6 +13,8 @@ Current public release: `deep-learning-core==0.0.26`.
|
|
|
12
13
|
Azure dataset foundations
|
|
13
14
|
- [`dl-mlflow`](https://github.com/Blazkowiz47/dl-mlflow): local MLflow
|
|
14
15
|
integration
|
|
16
|
+
- [`dl-robotics`](https://github.com/Blazkowiz47/dl-robotics): fast 2D MAPF
|
|
17
|
+
environments, episode metrics, and GIF/MP4 artifacts
|
|
15
18
|
- [`dl-wandb`](https://github.com/Blazkowiz47/dl-wandb): Weights & Biases
|
|
16
19
|
integration
|
|
17
20
|
|
{deep_learning_core-0.0.26 → deep_learning_core-0.0.27}/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.27"
|
|
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,16 @@ 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 _episode_manager_component(
|
|
636
|
+
registry_literal=registry_literal,
|
|
637
|
+
class_name=class_name,
|
|
638
|
+
import_path=episode_manager_base.import_path,
|
|
639
|
+
base_class=episode_manager_base.base_class,
|
|
640
|
+
class_docstring=episode_manager_base.class_docstring,
|
|
641
|
+
)
|
|
611
642
|
if spec.canonical_name == "model":
|
|
612
643
|
model_base = _component_base_required(component_base)
|
|
613
644
|
if _is_default_component_base(spec.canonical_name, model_base):
|
|
@@ -1930,6 +1961,41 @@ class {class_name}({base_class}):
|
|
|
1930
1961
|
'''
|
|
1931
1962
|
|
|
1932
1963
|
|
|
1964
|
+
def _episode_manager_component(
|
|
1965
|
+
*,
|
|
1966
|
+
registry_literal: str,
|
|
1967
|
+
class_name: str,
|
|
1968
|
+
import_path: str,
|
|
1969
|
+
base_class: str,
|
|
1970
|
+
class_docstring: str,
|
|
1971
|
+
) -> str:
|
|
1972
|
+
"""Render an episode-manager scaffold with summary customization."""
|
|
1973
|
+
return f'''"""Local episode manager scaffold."""
|
|
1974
|
+
|
|
1975
|
+
from __future__ import annotations
|
|
1976
|
+
|
|
1977
|
+
from dl_core.core import EpisodeRecord, EpisodeResult, register_episode_manager
|
|
1978
|
+
from {import_path} import {base_class}
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
@register_episode_manager({registry_literal})
|
|
1982
|
+
class {class_name}({base_class}):
|
|
1983
|
+
"""{class_docstring}"""
|
|
1984
|
+
|
|
1985
|
+
def summarize_episode(
|
|
1986
|
+
self,
|
|
1987
|
+
record: EpisodeRecord,
|
|
1988
|
+
result: EpisodeResult,
|
|
1989
|
+
**statistics: float | int,
|
|
1990
|
+
) -> dict[str, float]:
|
|
1991
|
+
"""Compute scalar metrics for one completed episode."""
|
|
1992
|
+
return {{
|
|
1993
|
+
"episode/return": float(statistics["episode_return"]),
|
|
1994
|
+
"episode/length": float(statistics["length"]),
|
|
1995
|
+
}}
|
|
1996
|
+
'''
|
|
1997
|
+
|
|
1998
|
+
|
|
1933
1999
|
def _model_component(
|
|
1934
2000
|
*,
|
|
1935
2001
|
registry_literal: str,
|
|
@@ -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",
|