drlab 0.2.8__tar.gz → 0.2.9__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.
- {drlab-0.2.8/src/drlab.egg-info → drlab-0.2.9}/PKG-INFO +1 -1
- {drlab-0.2.8 → drlab-0.2.9}/pyproject.toml +1 -1
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/__init__.py +1 -1
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/off_policy/base.py +4 -0
- {drlab-0.2.8 → drlab-0.2.9/src/drlab.egg-info}/PKG-INFO +1 -1
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_off_policy_experiment.py +5 -0
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_public_api.py +1 -1
- {drlab-0.2.8 → drlab-0.2.9}/LICENSE +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/README.md +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/setup.cfg +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/base.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/e_greedy.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/gaussian.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/greedy.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/stochastic.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/controllers/warmup.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/experiments/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/experiments/off_policy_experiment.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/experiments/on_policy_experiment.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/off_policy/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/off_policy/configs.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/off_policy/dqn.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/off_policy/sac.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/actor_critic.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/base.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/configs.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/ppo.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/learners/on_policy/reinforce.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/replay/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/replay/replay_buffer.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/replay/transition_batch.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/runners/__init__.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab/runners/runner.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab.egg-info/SOURCES.txt +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab.egg-info/dependency_links.txt +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab.egg-info/requires.txt +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/src/drlab.egg-info/top_level.txt +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_controllers.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_learners.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_replay.py +0 -0
- {drlab-0.2.8 → drlab-0.2.9}/tests/test_runner.py +0 -0
|
@@ -28,6 +28,10 @@ class OffPolicyLearner(ABC):
|
|
|
28
28
|
|
|
29
29
|
self._validate_config()
|
|
30
30
|
|
|
31
|
+
def reset_optimizers(self) -> None:
|
|
32
|
+
"""Reset optimizer state owned by the learner, if any."""
|
|
33
|
+
pass
|
|
34
|
+
|
|
31
35
|
def _validate_config(self) -> None:
|
|
32
36
|
if len(self.regularizers) != len(self.reg_lams):
|
|
33
37
|
raise ValueError("regularizers and reg_lams must have same length.")
|
|
@@ -71,6 +71,11 @@ def one_transition() -> TransitionBatch:
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
class OffPolicyExperimentTest(unittest.TestCase):
|
|
74
|
+
def test_base_learner_optimizer_reset_is_a_noop(self):
|
|
75
|
+
learner = CountingLearner()
|
|
76
|
+
|
|
77
|
+
self.assertIsNone(learner.reset_optimizers())
|
|
78
|
+
|
|
74
79
|
def make_experiment(self, config: OffPolicyExperimentConfig) -> OffPolicyExperiment:
|
|
75
80
|
env = OneStepEnv()
|
|
76
81
|
learner = CountingLearner()
|
|
@@ -37,7 +37,7 @@ class PublicAPITest(unittest.TestCase):
|
|
|
37
37
|
"WarmupController",
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
self.assertEqual(drlab.__version__, "0.2.
|
|
40
|
+
self.assertEqual(drlab.__version__, "0.2.9")
|
|
41
41
|
self.assertTrue(expected.issubset(set(drlab.__all__)))
|
|
42
42
|
for name in expected:
|
|
43
43
|
self.assertTrue(hasattr(drlab, name), name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|