tensor-optix 1.2.2__tar.gz → 1.2.3__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.
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/PKG-INFO +1 -1
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/pyproject.toml +1 -1
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/tf_ppo.py +10 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/tf_ppo_continuous.py +6 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/torch_ppo.py +6 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/torch_ppo_continuous.py +6 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/loop_controller.py +5 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix.egg-info/PKG-INFO +1 -1
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/README.md +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/setup.cfg +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/pytorch/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/pytorch/torch_agent.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/pytorch/torch_evaluator.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/tensorflow/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/tensorflow/tf_agent.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/adapters/tensorflow/tf_evaluator.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/tf_dqn.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/tf_sac.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/torch_dqn.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/algorithms/torch_sac.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/backoff_scheduler.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/base_agent.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/base_evaluator.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/base_optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/base_pipeline.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/checkpoint_registry.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/diagnostic_controller.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/ensemble_agent.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/meta_controller.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/normalizers.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/policy_manager.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/regime_detector.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/replay_buffer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/trajectory_buffer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/core/types.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/exploration/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/exploration/rnd.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizers/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizers/backoff_optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizers/momentum_optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizers/pbt_optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/optimizers/spsa_optimizer.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/orchestrator.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/pipeline/__init__.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/pipeline/batch_pipeline.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/pipeline/live_pipeline.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix/pipeline/vector_pipeline.py +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix.egg-info/SOURCES.txt +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix.egg-info/dependency_links.txt +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix.egg-info/requires.txt +0 -0
- {tensor_optix-1.2.2 → tensor_optix-1.2.3}/tensor_optix.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensor-optix"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.3"
|
|
8
8
|
description = "Autonomous training loop for any sequential learning model — built-in PPO, DQN, and SAC for TensorFlow and PyTorch"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -291,6 +291,16 @@ class TFPPOAgent(BaseAgent):
|
|
|
291
291
|
# Internal helpers
|
|
292
292
|
# ------------------------------------------------------------------
|
|
293
293
|
|
|
294
|
+
def reset_cache(self) -> None:
|
|
295
|
+
"""
|
|
296
|
+
Discard all entries in the rollout cache without learning from them.
|
|
297
|
+
Called by LoopController after a val-pipeline window is collected, so
|
|
298
|
+
that val-rollout entries never bleed into the next training learn() call.
|
|
299
|
+
"""
|
|
300
|
+
self._cache_obs.clear()
|
|
301
|
+
self._cache_log_probs.clear()
|
|
302
|
+
self._cache_values.clear()
|
|
303
|
+
|
|
294
304
|
def _clear_cache(self, T: int) -> None:
|
|
295
305
|
del self._cache_obs[:T]
|
|
296
306
|
del self._cache_log_probs[:T]
|
|
@@ -319,6 +319,12 @@ class TFGaussianPPOAgent(BaseAgent):
|
|
|
319
319
|
for v in module.trainable_variables:
|
|
320
320
|
v.assign(v * (1.0 + noise_scale * tf.random.normal(v.shape)))
|
|
321
321
|
|
|
322
|
+
def reset_cache(self) -> None:
|
|
323
|
+
"""Discard all rollout cache entries without learning from them."""
|
|
324
|
+
self._cache_obs.clear()
|
|
325
|
+
self._cache_log_probs.clear()
|
|
326
|
+
self._cache_values.clear()
|
|
327
|
+
|
|
322
328
|
@staticmethod
|
|
323
329
|
def _explained_variance(values: np.ndarray, returns: np.ndarray) -> float:
|
|
324
330
|
var_returns = float(np.var(returns))
|
|
@@ -275,6 +275,12 @@ class TorchPPOAgent(BaseAgent):
|
|
|
275
275
|
for param in module.parameters():
|
|
276
276
|
param.mul_(1.0 + noise_scale * torch.randn_like(param))
|
|
277
277
|
|
|
278
|
+
def reset_cache(self) -> None:
|
|
279
|
+
"""Discard all rollout cache entries without learning from them."""
|
|
280
|
+
self._cache_obs.clear()
|
|
281
|
+
self._cache_log_probs.clear()
|
|
282
|
+
self._cache_values.clear()
|
|
283
|
+
|
|
278
284
|
@staticmethod
|
|
279
285
|
def _explained_variance(values: np.ndarray, returns: np.ndarray) -> float:
|
|
280
286
|
var_returns = float(np.var(returns))
|
|
@@ -343,6 +343,12 @@ class TorchGaussianPPOAgent(BaseAgent):
|
|
|
343
343
|
for param in module.parameters():
|
|
344
344
|
param.mul_(1.0 + noise_scale * torch.randn_like(param))
|
|
345
345
|
|
|
346
|
+
def reset_cache(self) -> None:
|
|
347
|
+
"""Discard all rollout cache entries without learning from them."""
|
|
348
|
+
self._cache_obs.clear()
|
|
349
|
+
self._cache_log_probs.clear()
|
|
350
|
+
self._cache_values.clear()
|
|
351
|
+
|
|
346
352
|
@staticmethod
|
|
347
353
|
def _explained_variance(values: np.ndarray, returns: np.ndarray) -> float:
|
|
348
354
|
var_returns = float(np.var(returns))
|
|
@@ -227,6 +227,11 @@ class LoopController:
|
|
|
227
227
|
val_episode = next(self._val_gen)
|
|
228
228
|
val_episode.episode_id = episode_id
|
|
229
229
|
val_metrics = self._evaluator.score_validation(val_episode)
|
|
230
|
+
# Val pipeline calls agent.act() to collect rollouts, which
|
|
231
|
+
# populates the on-policy rollout cache. That data must never
|
|
232
|
+
# be consumed by the next training learn() call. Clear it now.
|
|
233
|
+
if hasattr(self._agent, "reset_cache"):
|
|
234
|
+
self._agent.reset_cache()
|
|
230
235
|
eval_metrics = self._evaluator.combine(train_metrics, val_metrics)
|
|
231
236
|
eval_metrics.episode_id = episode_id
|
|
232
237
|
logger.debug(
|
|
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
|
|
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
|