tensor-optix 2.2.0__tar.gz → 2.2.1__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.
Files changed (228) hide show
  1. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/PKG-INFO +51 -1
  2. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/README.md +50 -0
  3. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/pyproject.toml +1 -1
  4. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/budget.py +110 -110
  5. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ledger_bridge.py +111 -111
  6. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/meta_features.py +55 -55
  7. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/__init__.py +1 -1
  8. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/data.py +237 -237
  9. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/baseline.py +37 -37
  10. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/boosting.py +176 -176
  11. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/knn.py +69 -69
  12. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/linear.py +104 -104
  13. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/mlp.py +135 -135
  14. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/naive_bayes.py +88 -88
  15. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/native_gbdt.py +70 -70
  16. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/tree.py +131 -131
  17. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/feature_gen.py +235 -235
  18. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/splits.py +321 -321
  19. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/target.py +197 -197
  20. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/types.py +275 -275
  21. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/report/__init__.py +5 -5
  22. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/report/io.py +29 -29
  23. tensor_optix-2.2.1/tensor_optix/discovery/report/render.py +920 -0
  24. tensor_optix-2.2.1/tensor_optix/discovery/report/svg.py +308 -0
  25. tensor_optix-2.2.1/tensor_optix/discovery/report/template.py +336 -0
  26. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/build.py +123 -123
  27. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/trials.py +150 -150
  28. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rng.py +45 -45
  29. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/schema.py +465 -465
  30. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/__init__.py +14 -14
  31. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/compare.py +110 -110
  32. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/distributions.py +217 -217
  33. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/hypothesis.py +124 -124
  34. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/metrics.py +213 -213
  35. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/gbdt/__init__.py +16 -16
  36. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/PKG-INFO +51 -1
  37. tensor_optix-2.2.0/tensor_optix/discovery/report/render.py +0 -449
  38. tensor_optix-2.2.0/tensor_optix/discovery/report/svg.py +0 -163
  39. tensor_optix-2.2.0/tensor_optix/discovery/report/template.py +0 -127
  40. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/setup.cfg +0 -0
  41. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/__init__.py +0 -0
  42. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/__init__.py +0 -0
  43. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/jax/__init__.py +0 -0
  44. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/jax/flax_agent.py +0 -0
  45. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/jax/flax_evaluator.py +0 -0
  46. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/pytorch/__init__.py +0 -0
  47. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/pytorch/torch_agent.py +0 -0
  48. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/pytorch/torch_evaluator.py +0 -0
  49. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/tensorflow/__init__.py +0 -0
  50. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/tensorflow/tf_agent.py +0 -0
  51. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/adapters/tensorflow/tf_evaluator.py +0 -0
  52. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/__init__.py +0 -0
  53. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/flax_ppo.py +0 -0
  54. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/tf_dqn.py +0 -0
  55. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/tf_ppo.py +0 -0
  56. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/tf_ppo_continuous.py +0 -0
  57. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/tf_sac.py +0 -0
  58. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/tf_td3.py +0 -0
  59. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_dqn.py +0 -0
  60. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_ppo.py +0 -0
  61. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_ppo_continuous.py +0 -0
  62. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_rainbow_dqn.py +0 -0
  63. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_recurrent_ppo.py +0 -0
  64. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_sac.py +0 -0
  65. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/algorithms/torch_td3.py +0 -0
  66. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/callbacks/__init__.py +0 -0
  67. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/callbacks/rich_dashboard.py +0 -0
  68. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/callbacks/tensorboard_callback.py +0 -0
  69. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/callbacks/wandb_callback.py +0 -0
  70. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/cli.py +0 -0
  71. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/config.py +0 -0
  72. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/__init__.py +0 -0
  73. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/async_callback.py +0 -0
  74. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/backoff_scheduler.py +0 -0
  75. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/base_agent.py +0 -0
  76. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/base_evaluator.py +0 -0
  77. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/base_optimizer.py +0 -0
  78. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/base_pipeline.py +0 -0
  79. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/checkpoint_confirmation.py +0 -0
  80. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/checkpoint_registry.py +0 -0
  81. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/convergence.py +0 -0
  82. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/device.py +0 -0
  83. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/diagnostic_controller.py +0 -0
  84. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/ensemble_agent.py +0 -0
  85. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/her_buffer.py +0 -0
  86. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/loop_controller.py +0 -0
  87. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/meta_controller.py +0 -0
  88. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/noisy_linear.py +0 -0
  89. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/normalizers.py +0 -0
  90. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/obs_utils.py +0 -0
  91. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/policy_manager.py +0 -0
  92. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/regime_detector.py +0 -0
  93. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/replay_buffer.py +0 -0
  94. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/resume_state.py +0 -0
  95. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/reward_shape.py +0 -0
  96. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/trajectory_buffer.py +0 -0
  97. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/core/types.py +0 -0
  98. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/__init__.py +0 -0
  99. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/api.py +0 -0
  100. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/build.py +0 -0
  101. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/findings.py +0 -0
  102. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/build.py +0 -0
  103. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/evaluate.py +0 -0
  104. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/families/base.py +0 -0
  105. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/features.py +0 -0
  106. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/landmarks.py +0 -0
  107. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/leakage.py +0 -0
  108. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/pipeline.py +0 -0
  109. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/preprocess.py +0 -0
  110. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/quality.py +0 -0
  111. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/recommend.py +0 -0
  112. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/shift.py +0 -0
  113. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/structure.py +0 -0
  114. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/ml/trials.py +0 -0
  115. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/__init__.py +0 -0
  116. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/env.py +0 -0
  117. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/pipeline.py +0 -0
  118. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/rl/probes.py +0 -0
  119. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/discovery/stats/intervals.py +0 -0
  120. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/distributed/__init__.py +0 -0
  121. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/distributed/async_learner.py +0 -0
  122. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/distributed/vtrace.py +0 -0
  123. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/encoders/__init__.py +0 -0
  124. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/encoders/obs_encoder.py +0 -0
  125. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/encoders/obs_encoder_tf.py +0 -0
  126. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/exploration/__init__.py +0 -0
  127. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/exploration/rnd.py +0 -0
  128. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/factory.py +0 -0
  129. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/gbdt/booster.py +0 -0
  130. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/gbdt/core.py +0 -0
  131. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/__init__.py +0 -0
  132. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/callback.py +0 -0
  133. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/provenance.py +0 -0
  134. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/records.py +0 -0
  135. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/schema.py +0 -0
  136. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ledger/store.py +0 -0
  137. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml/__init__.py +0 -0
  138. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml/dataset_pipeline.py +0 -0
  139. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml/loss_registry.py +0 -0
  140. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml/ml_agent.py +0 -0
  141. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/__init__.py +0 -0
  142. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/adapters/__init__.py +0 -0
  143. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/adapters/flax_model.py +0 -0
  144. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/adapters/tf_model.py +0 -0
  145. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/adapters/torch_model.py +0 -0
  146. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/base_model.py +0 -0
  147. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/lr_schedules.py +0 -0
  148. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/metrics.py +0 -0
  149. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/metrics_impl/__init__.py +0 -0
  150. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/metrics_impl/classification.py +0 -0
  151. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/metrics_impl/regression.py +0 -0
  152. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/trainer.py +0 -0
  153. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/ml_core/transfer.py +0 -0
  154. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/__init__.py +0 -0
  155. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/aec_pipeline.py +0 -0
  156. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/multi_agent_episode.py +0 -0
  157. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/multi_agent_runtime.py +0 -0
  158. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/parallel_pipeline.py +0 -0
  159. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/seat_env.py +0 -0
  160. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/multi_agent/self_play.py +0 -0
  161. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/__init__.py +0 -0
  162. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/abstention.py +0 -0
  163. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/features.py +0 -0
  164. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/pooling.py +0 -0
  165. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/selector.py +0 -0
  166. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/nanonets/smalln.py +0 -0
  167. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/__init__.py +0 -0
  168. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/agent/__init__.py +0 -0
  169. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/agent/graph_agent.py +0 -0
  170. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/brain_network.py +0 -0
  171. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/controller/__init__.py +0 -0
  172. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/controller/topology_callback.py +0 -0
  173. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/controller/topology_controller.py +0 -0
  174. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/graph/__init__.py +0 -0
  175. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/graph/neuron.py +0 -0
  176. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/graph/neuron_graph.py +0 -0
  177. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/graph/topology_ops.py +0 -0
  178. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/hebbian.py +0 -0
  179. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/neuromodulator.py +0 -0
  180. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/optimizer/__init__.py +0 -0
  181. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/neuroevo/optimizer/topology_aware_adam.py +0 -0
  182. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizer.py +0 -0
  183. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/__init__.py +0 -0
  184. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/adaptive_optimizer.py +0 -0
  185. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/backoff_optimizer.py +0 -0
  186. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/momentum_optimizer.py +0 -0
  187. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/pbt_optimizer.py +0 -0
  188. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/optimizers/spsa_optimizer.py +0 -0
  189. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/orchestrator.py +0 -0
  190. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/pipeline/__init__.py +0 -0
  191. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/pipeline/batch_pipeline.py +0 -0
  192. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/pipeline/live_pipeline.py +0 -0
  193. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/pipeline/vector_pipeline.py +0 -0
  194. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/__init__.py +0 -0
  195. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/baseline.py +0 -0
  196. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/experiment_stage.py +0 -0
  197. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/live_runtime.py +0 -0
  198. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/observer.py +0 -0
  199. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/runtime/promote.py +0 -0
  200. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/__init__.py +0 -0
  201. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/_mp_common.py +0 -0
  202. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/budget.py +0 -0
  203. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/dedup.py +0 -0
  204. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/isolation.py +0 -0
  205. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/pool.py +0 -0
  206. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/retry.py +0 -0
  207. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/scheduler/worker.py +0 -0
  208. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/selection/__init__.py +0 -0
  209. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/selection/backfill.py +0 -0
  210. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/selection/selector.py +0 -0
  211. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/selection/uncertainty.py +0 -0
  212. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/simple.py +0 -0
  213. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/__init__.py +0 -0
  214. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/candidate.py +0 -0
  215. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/comparator.py +0 -0
  216. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/grammar.py +0 -0
  217. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/promotion.py +0 -0
  218. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/runner.py +0 -0
  219. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/strategy/worker.py +0 -0
  220. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/utils/__init__.py +0 -0
  221. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/utils/console.py +0 -0
  222. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix/utils/window_size.py +0 -0
  223. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/SOURCES.txt +0 -0
  224. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/dependency_links.txt +0 -0
  225. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/entry_points.txt +0 -0
  226. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/requires.txt +0 -0
  227. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tensor_optix.egg-info/top_level.txt +0 -0
  228. {tensor_optix-2.2.0 → tensor_optix-2.2.1}/tests/test_ml.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tensor-optix
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Autonomous training loop for any sequential learning model — PPO, DQN, SAC, TD3, Rainbow DQN, Recurrent PPO for TensorFlow, PyTorch, and JAX/Flax; distributed async actor-learner (IMPALA + V-trace)
5
5
  Author: sup3rus3r
6
6
  License-Expression: MIT
@@ -88,6 +88,8 @@ It has two parallel cores:
88
88
  - **RL core**. An episode-driven loop (`LoopController`/`RLOptimizer`) built around `BaseAgent`'s `act()`/`learn()` contract. Statistical convergence control, SPSA-based online hyperparameter tuning, and an optional neuroevolution subsystem for dynamic topology.
89
89
  - **ML core** (`tensor_optix.ml_core`). An epoch/batch-driven loop (`Trainer`, wrapped by `BaseMLModel.fit()`) built around a sklearn-style `fit()`/`predict()`/`evaluate()` contract. Real classification metrics (accuracy, precision/recall/F1, confusion matrix) and regression metrics (MAE, RMSE, R²), validation-based early stopping, and checkpointing on the best metric.
90
90
 
91
+ On top of both sits **discovery** (`tensor_optix.discovery`): point it at a dataset or a Gymnasium environment and it profiles the data, compares model families or RL algorithms under a fixed budget, and recommends one with statistical evidence. See [Discovery](#discovery) below.
92
+
91
93
  Both cores reuse the same lower-level, algorithm-agnostic machinery: `CheckpointRegistry`, the `ConvergenceMonitor` convergence detector, `SPSAOptimizer`. Each core has its own contract on top because an RL episode and a training epoch aren't the same shape. See [Concepts](https://sup3rus3r.github.io/tensor-optix/getting-started/concepts/).
92
94
 
93
95
  ## RL core
@@ -148,6 +150,50 @@ Metrics are auto-detected from the target dtype. Integer/class-index targets get
148
150
 
149
151
  There is also an older, RL-loop-based way to train an arbitrary `nn.Module`: `Optimizer(model, dataset)`, which runs the model through the RL loop as a fake episode. See [ML support](#ml-support) below. It predates `ml_core`, is kept for backward compatibility, and has no real classification/regression metrics and no validation-based early stopping. Use `ml_core` for new code.
150
152
 
153
+ ## Discovery
154
+
155
+ `tensor_optix.discovery` answers the questions before training: what is in this data, how must it be validated, and which model family (or RL algorithm) fits it? It runs statistical tests and short, paired experiments under an explicit budget, and writes a self-contained HTML report with the recommendation, the evidence, and its uncertainty.
156
+
157
+ ```python
158
+ from tensor_optix.discovery import discover
159
+
160
+ report = discover(df, target="churned") # a DataFrame, dict of columns, or (X, y) arrays
161
+ report.to_html("discovery.html") # static report, works offline
162
+ print(report.summary()) # the same content as text
163
+ ```
164
+
165
+ For a dataset it:
166
+
167
+ - profiles the target and every column (inferred types, missingness, duplicates, outliers);
168
+ - detects the structure that decides the split (grouped rows, temporal order, a row order that carries the target) and keeps a confirmation holdout cut with that structure;
169
+ - looks for leakage (a single column that predicts the target almost perfectly, identifiers, predictive missingness) and train/test shift;
170
+ - runs cheap landmark models to show whether the problem has signal, non-linearity or interactions;
171
+ - compares candidate families (linear, naive Bayes, k-NN, MLP, boosted trees) on identical folds, adding CV repeats while the leaders cannot be separated;
172
+ - recommends the simplest family that is not worse than the best, scores it once on the holdout, and suggests feature families and scalers that measurably help.
173
+
174
+ For a Gymnasium environment, the same entry point probes the environment with a random policy (spaces, reward sparsity and scale, observation scale, determinism, partial observability). It then trains every applicable algorithm (PPO / DQN for discrete actions, SAC / TD3 / PPO for continuous ones) for the same steps on the same seeds, and recommends one:
175
+
176
+ ```python
177
+ import gymnasium as gym
178
+ from tensor_optix.discovery import discover, Budget
179
+
180
+ report = discover(gym.make("CartPole-v1"))
181
+ report = discover("Pendulum-v1", kind="rl", budget=Budget(env_steps=300_000))
182
+ ```
183
+
184
+ Discovery **advises; it never changes anything on its own**. Every finding has a stable id and a severity (`info`, `advisory`, `warning`, `critical`). You accept or reject each one, and `build()` applies only the accepted findings:
185
+
186
+ ```python
187
+ report.accept("structure.grouped:col=customer_id")
188
+ report.reject("leakage.single_feature:col=refund_flag", note="known at prediction time")
189
+
190
+ solution = report.build() # refuses while a critical finding is still pending
191
+ solution.fit(df, target="churned")
192
+ solution.predict(new_rows)
193
+ ```
194
+
195
+ The report JSON is embedded in the HTML, so `DiscoveryReport.from_html("discovery.html")` reloads it exactly. Pass `store=ExperimentStore(...)` to record the run in the [experiment ledger](#experiment-ledger). Full guide: [Understand your data and choose a model family](https://sup3rus3r.github.io/tensor-optix/guides/discovery/).
196
+
151
197
  ---
152
198
 
153
199
  ## Install
@@ -168,6 +214,10 @@ pip install tensor-optix[jax]
168
214
  # Neuroevo (requires torch)
169
215
  pip install tensor-optix[neuroevo]
170
216
 
217
+ # Discovery: DataFrame input, LightGBM / XGBoost candidates
218
+ pip install tensor-optix[pandas]
219
+ pip install tensor-optix[discovery-boost]
220
+
171
221
  # GPU (Linux/WSL2, CUDA 12.8)
172
222
  pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
173
223
  pip install tensor-optix[torch]
@@ -9,6 +9,8 @@ It has two parallel cores:
9
9
  - **RL core**. An episode-driven loop (`LoopController`/`RLOptimizer`) built around `BaseAgent`'s `act()`/`learn()` contract. Statistical convergence control, SPSA-based online hyperparameter tuning, and an optional neuroevolution subsystem for dynamic topology.
10
10
  - **ML core** (`tensor_optix.ml_core`). An epoch/batch-driven loop (`Trainer`, wrapped by `BaseMLModel.fit()`) built around a sklearn-style `fit()`/`predict()`/`evaluate()` contract. Real classification metrics (accuracy, precision/recall/F1, confusion matrix) and regression metrics (MAE, RMSE, R²), validation-based early stopping, and checkpointing on the best metric.
11
11
 
12
+ On top of both sits **discovery** (`tensor_optix.discovery`): point it at a dataset or a Gymnasium environment and it profiles the data, compares model families or RL algorithms under a fixed budget, and recommends one with statistical evidence. See [Discovery](#discovery) below.
13
+
12
14
  Both cores reuse the same lower-level, algorithm-agnostic machinery: `CheckpointRegistry`, the `ConvergenceMonitor` convergence detector, `SPSAOptimizer`. Each core has its own contract on top because an RL episode and a training epoch aren't the same shape. See [Concepts](https://sup3rus3r.github.io/tensor-optix/getting-started/concepts/).
13
15
 
14
16
  ## RL core
@@ -69,6 +71,50 @@ Metrics are auto-detected from the target dtype. Integer/class-index targets get
69
71
 
70
72
  There is also an older, RL-loop-based way to train an arbitrary `nn.Module`: `Optimizer(model, dataset)`, which runs the model through the RL loop as a fake episode. See [ML support](#ml-support) below. It predates `ml_core`, is kept for backward compatibility, and has no real classification/regression metrics and no validation-based early stopping. Use `ml_core` for new code.
71
73
 
74
+ ## Discovery
75
+
76
+ `tensor_optix.discovery` answers the questions before training: what is in this data, how must it be validated, and which model family (or RL algorithm) fits it? It runs statistical tests and short, paired experiments under an explicit budget, and writes a self-contained HTML report with the recommendation, the evidence, and its uncertainty.
77
+
78
+ ```python
79
+ from tensor_optix.discovery import discover
80
+
81
+ report = discover(df, target="churned") # a DataFrame, dict of columns, or (X, y) arrays
82
+ report.to_html("discovery.html") # static report, works offline
83
+ print(report.summary()) # the same content as text
84
+ ```
85
+
86
+ For a dataset it:
87
+
88
+ - profiles the target and every column (inferred types, missingness, duplicates, outliers);
89
+ - detects the structure that decides the split (grouped rows, temporal order, a row order that carries the target) and keeps a confirmation holdout cut with that structure;
90
+ - looks for leakage (a single column that predicts the target almost perfectly, identifiers, predictive missingness) and train/test shift;
91
+ - runs cheap landmark models to show whether the problem has signal, non-linearity or interactions;
92
+ - compares candidate families (linear, naive Bayes, k-NN, MLP, boosted trees) on identical folds, adding CV repeats while the leaders cannot be separated;
93
+ - recommends the simplest family that is not worse than the best, scores it once on the holdout, and suggests feature families and scalers that measurably help.
94
+
95
+ For a Gymnasium environment, the same entry point probes the environment with a random policy (spaces, reward sparsity and scale, observation scale, determinism, partial observability). It then trains every applicable algorithm (PPO / DQN for discrete actions, SAC / TD3 / PPO for continuous ones) for the same steps on the same seeds, and recommends one:
96
+
97
+ ```python
98
+ import gymnasium as gym
99
+ from tensor_optix.discovery import discover, Budget
100
+
101
+ report = discover(gym.make("CartPole-v1"))
102
+ report = discover("Pendulum-v1", kind="rl", budget=Budget(env_steps=300_000))
103
+ ```
104
+
105
+ Discovery **advises; it never changes anything on its own**. Every finding has a stable id and a severity (`info`, `advisory`, `warning`, `critical`). You accept or reject each one, and `build()` applies only the accepted findings:
106
+
107
+ ```python
108
+ report.accept("structure.grouped:col=customer_id")
109
+ report.reject("leakage.single_feature:col=refund_flag", note="known at prediction time")
110
+
111
+ solution = report.build() # refuses while a critical finding is still pending
112
+ solution.fit(df, target="churned")
113
+ solution.predict(new_rows)
114
+ ```
115
+
116
+ The report JSON is embedded in the HTML, so `DiscoveryReport.from_html("discovery.html")` reloads it exactly. Pass `store=ExperimentStore(...)` to record the run in the [experiment ledger](#experiment-ledger). Full guide: [Understand your data and choose a model family](https://sup3rus3r.github.io/tensor-optix/guides/discovery/).
117
+
72
118
  ---
73
119
 
74
120
  ## Install
@@ -89,6 +135,10 @@ pip install tensor-optix[jax]
89
135
  # Neuroevo (requires torch)
90
136
  pip install tensor-optix[neuroevo]
91
137
 
138
+ # Discovery: DataFrame input, LightGBM / XGBoost candidates
139
+ pip install tensor-optix[pandas]
140
+ pip install tensor-optix[discovery-boost]
141
+
92
142
  # GPU (Linux/WSL2, CUDA 12.8)
93
143
  pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
94
144
  pip install tensor-optix[torch]
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tensor-optix"
7
- version = "2.2.0"
7
+ version = "2.2.1"
8
8
  description = "Autonomous training loop for any sequential learning model — PPO, DQN, SAC, TD3, Rainbow DQN, Recurrent PPO for TensorFlow, PyTorch, and JAX/Flax; distributed async actor-learner (IMPALA + V-trace)"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,110 +1,110 @@
1
- """
2
- Discovery budgets: how much time, data and compute discovery may spend.
3
-
4
- ``Budget`` is what the user asks for; ``BudgetLedger`` tracks what has been
5
- spent and predicts whether the next stage fits. When a stage would overrun,
6
- discovery shrinks it in a fixed, documented order (fewer configurations, then
7
- fewer repeats, then fewer rows) and records each cut as a BUDGET finding --
8
- it never silently runs over or silently does less.
9
- """
10
- from __future__ import annotations
11
-
12
- import math
13
- import time
14
- from dataclasses import dataclass, field
15
- from typing import Any, Dict, Optional
16
-
17
-
18
- @dataclass(frozen=True)
19
- class Budget:
20
- """
21
- Args:
22
- time_s: wall-clock seconds for the whole discovery run.
23
- max_rows: cap on rows used for model fitting (ML). None = decided by
24
- the sample-size rule and ``time_s``.
25
- max_fits: cap on individual model fits (ML) / short trials (RL).
26
- env_steps: cap on environment steps across all probes and trials (RL).
27
- """
28
-
29
- time_s: float = 600.0
30
- max_rows: Optional[int] = None
31
- max_fits: Optional[int] = None
32
- env_steps: Optional[int] = None
33
-
34
- def __post_init__(self):
35
- if not (self.time_s > 0 and math.isfinite(self.time_s)):
36
- raise ValueError(f"time_s must be a positive finite number, got {self.time_s!r}")
37
- for name in ("max_rows", "max_fits", "env_steps"):
38
- v = getattr(self, name)
39
- if v is not None and (not isinstance(v, int) or v <= 0):
40
- raise ValueError(f"{name} must be a positive int or None, got {v!r}")
41
-
42
- @classmethod
43
- def default_for_rows(cls, n_rows: int) -> "Budget":
44
- """About 60 s at 10k rows, growing with log size, capped at 15 minutes."""
45
- n = max(int(n_rows), 1)
46
- t = 60.0 * (1.0 + max(0.0, math.log10(n / 10_000.0)) * 2.0)
47
- return cls(time_s=float(min(max(t, 30.0), 900.0)))
48
-
49
- def to_dict(self) -> Dict[str, Any]:
50
- return {"time_s": self.time_s, "max_rows": self.max_rows,
51
- "max_fits": self.max_fits, "env_steps": self.env_steps}
52
-
53
-
54
- @dataclass
55
- class BudgetLedger:
56
- """Running account of a discovery run's spend."""
57
-
58
- budget: Budget
59
- started_at: float = field(default_factory=time.perf_counter)
60
- fits: int = 0
61
- env_steps: int = 0
62
- rows_fitted: int = 0
63
- cuts: list = field(default_factory=list) # (stage, what, reason)
64
-
65
- def elapsed(self) -> float:
66
- return time.perf_counter() - self.started_at
67
-
68
- def remaining_s(self) -> float:
69
- return max(0.0, self.budget.time_s - self.elapsed())
70
-
71
- def exhausted(self) -> bool:
72
- if self.remaining_s() <= 0.0:
73
- return True
74
- if self.budget.max_fits is not None and self.fits >= self.budget.max_fits:
75
- return True
76
- if self.budget.env_steps is not None and self.env_steps >= self.budget.env_steps:
77
- return True
78
- return False
79
-
80
- def fits_left(self) -> Optional[int]:
81
- if self.budget.max_fits is None:
82
- return None
83
- return max(0, self.budget.max_fits - self.fits)
84
-
85
- def record_fit(self, n_rows: int = 0) -> None:
86
- self.fits += 1
87
- self.rows_fitted += int(n_rows)
88
-
89
- def record_steps(self, n: int) -> None:
90
- self.env_steps += int(n)
91
-
92
- def record_cut(self, stage: str, what: str, reason: str) -> None:
93
- self.cuts.append((stage, what, reason))
94
-
95
- def to_dict(self) -> Dict[str, Any]:
96
- return {"elapsed_s": round(self.elapsed(), 3), "fits": self.fits,
97
- "env_steps": self.env_steps, "rows_fitted": self.rows_fitted,
98
- "cuts": [{"stage": s, "what": w, "reason": r} for s, w, r in self.cuts]}
99
-
100
-
101
- def predict_cost(t_ref: float, n_ref: int, n: int, exponent: float = 1.0) -> float:
102
- """
103
- Extrapolate a measured fit time ``t_ref`` at ``n_ref`` rows to ``n`` rows
104
- with ``t(n) = t_ref * (n / n_ref) ** exponent``; the exponent is clamped to
105
- [1, 2] (no estimator here is sub-linear or worse than quadratic in rows).
106
- """
107
- if n_ref <= 0 or t_ref < 0:
108
- raise ValueError("predict_cost needs n_ref > 0 and t_ref >= 0")
109
- a = min(max(float(exponent), 1.0), 2.0)
110
- return float(t_ref) * (max(n, 1) / n_ref) ** a
1
+ """
2
+ Discovery budgets: how much time, data and compute discovery may spend.
3
+
4
+ ``Budget`` is what the user asks for; ``BudgetLedger`` tracks what has been
5
+ spent and predicts whether the next stage fits. When a stage would overrun,
6
+ discovery shrinks it in a fixed, documented order (fewer configurations, then
7
+ fewer repeats, then fewer rows) and records each cut as a BUDGET finding --
8
+ it never silently runs over or silently does less.
9
+ """
10
+ from __future__ import annotations
11
+
12
+ import math
13
+ import time
14
+ from dataclasses import dataclass, field
15
+ from typing import Any, Dict, Optional
16
+
17
+
18
+ @dataclass(frozen=True)
19
+ class Budget:
20
+ """
21
+ Args:
22
+ time_s: wall-clock seconds for the whole discovery run.
23
+ max_rows: cap on rows used for model fitting (ML). None = decided by
24
+ the sample-size rule and ``time_s``.
25
+ max_fits: cap on individual model fits (ML) / short trials (RL).
26
+ env_steps: cap on environment steps across all probes and trials (RL).
27
+ """
28
+
29
+ time_s: float = 600.0
30
+ max_rows: Optional[int] = None
31
+ max_fits: Optional[int] = None
32
+ env_steps: Optional[int] = None
33
+
34
+ def __post_init__(self):
35
+ if not (self.time_s > 0 and math.isfinite(self.time_s)):
36
+ raise ValueError(f"time_s must be a positive finite number, got {self.time_s!r}")
37
+ for name in ("max_rows", "max_fits", "env_steps"):
38
+ v = getattr(self, name)
39
+ if v is not None and (not isinstance(v, int) or v <= 0):
40
+ raise ValueError(f"{name} must be a positive int or None, got {v!r}")
41
+
42
+ @classmethod
43
+ def default_for_rows(cls, n_rows: int) -> "Budget":
44
+ """About 60 s at 10k rows, growing with log size, capped at 15 minutes."""
45
+ n = max(int(n_rows), 1)
46
+ t = 60.0 * (1.0 + max(0.0, math.log10(n / 10_000.0)) * 2.0)
47
+ return cls(time_s=float(min(max(t, 30.0), 900.0)))
48
+
49
+ def to_dict(self) -> Dict[str, Any]:
50
+ return {"time_s": self.time_s, "max_rows": self.max_rows,
51
+ "max_fits": self.max_fits, "env_steps": self.env_steps}
52
+
53
+
54
+ @dataclass
55
+ class BudgetLedger:
56
+ """Running account of a discovery run's spend."""
57
+
58
+ budget: Budget
59
+ started_at: float = field(default_factory=time.perf_counter)
60
+ fits: int = 0
61
+ env_steps: int = 0
62
+ rows_fitted: int = 0
63
+ cuts: list = field(default_factory=list) # (stage, what, reason)
64
+
65
+ def elapsed(self) -> float:
66
+ return time.perf_counter() - self.started_at
67
+
68
+ def remaining_s(self) -> float:
69
+ return max(0.0, self.budget.time_s - self.elapsed())
70
+
71
+ def exhausted(self) -> bool:
72
+ if self.remaining_s() <= 0.0:
73
+ return True
74
+ if self.budget.max_fits is not None and self.fits >= self.budget.max_fits:
75
+ return True
76
+ if self.budget.env_steps is not None and self.env_steps >= self.budget.env_steps:
77
+ return True
78
+ return False
79
+
80
+ def fits_left(self) -> Optional[int]:
81
+ if self.budget.max_fits is None:
82
+ return None
83
+ return max(0, self.budget.max_fits - self.fits)
84
+
85
+ def record_fit(self, n_rows: int = 0) -> None:
86
+ self.fits += 1
87
+ self.rows_fitted += int(n_rows)
88
+
89
+ def record_steps(self, n: int) -> None:
90
+ self.env_steps += int(n)
91
+
92
+ def record_cut(self, stage: str, what: str, reason: str) -> None:
93
+ self.cuts.append((stage, what, reason))
94
+
95
+ def to_dict(self) -> Dict[str, Any]:
96
+ return {"elapsed_s": round(self.elapsed(), 3), "fits": self.fits,
97
+ "env_steps": self.env_steps, "rows_fitted": self.rows_fitted,
98
+ "cuts": [{"stage": s, "what": w, "reason": r} for s, w, r in self.cuts]}
99
+
100
+
101
+ def predict_cost(t_ref: float, n_ref: int, n: int, exponent: float = 1.0) -> float:
102
+ """
103
+ Extrapolate a measured fit time ``t_ref`` at ``n_ref`` rows to ``n`` rows
104
+ with ``t(n) = t_ref * (n / n_ref) ** exponent``; the exponent is clamped to
105
+ [1, 2] (no estimator here is sub-linear or worse than quadratic in rows).
106
+ """
107
+ if n_ref <= 0 or t_ref < 0:
108
+ raise ValueError("predict_cost needs n_ref > 0 and t_ref >= 0")
109
+ a = min(max(float(exponent), 1.0), 2.0)
110
+ return float(t_ref) * (max(n, 1) / n_ref) ** a
@@ -1,111 +1,111 @@
1
- """
2
- Opt-in recording of a discovery run in the tensor-optix experiment ledger
3
- (``discover(..., store=ExperimentStore(path) or path)``).
4
-
5
- Layout (no ledger schema change -- plain experiments and events):
6
- * one parent experiment: ``algorithm="discovery"``, ``task_env="discovery:<data fingerprint>"``,
7
- ``config={"role": "discovery", ...}``;
8
- * one child per family trial: ``algorithm="discovery_trial"``,
9
- ``parent_experiment_id=<parent>``, ``config={"role": "discovery_trial", "family": ...,
10
- "family_config": {...}}``, CV mean / interval in ``final_metrics``;
11
- * parent events: ``discovery.profile`` (versioned meta-features), one ``discovery.finding``
12
- per finding, ``discovery.decision`` (decisions at record time), ``discovery.recommendation``,
13
- ``discovery.budget``.
14
-
15
- Guardrails:
16
- * records live under their own ``task_env`` namespace, so selectors that
17
- query a task's history never see them;
18
- * no config uses the keys the method selector treats as evidence
19
- (``sampler``, ``op_name``, ``is_baseline``) -- checked before writing;
20
- * ``best_primary_score`` is never set (discovery metrics are not all
21
- higher-is-better); scores go to ``final_metrics`` with the metric name.
22
- """
23
- from __future__ import annotations
24
-
25
- import time
26
- import uuid
27
- from typing import Any, Dict, Union
28
-
29
- from .findings import jsonable
30
- from .schema import DiscoveryReport
31
-
32
- RESERVED_CONFIG_KEYS = ("sampler", "op_name", "is_baseline")
33
-
34
-
35
- def _check(config: Dict[str, Any]) -> Dict[str, Any]:
36
- bad = [k for k in RESERVED_CONFIG_KEYS if k in config]
37
- if bad:
38
- raise ValueError(f"discovery ledger config must not use {bad} (they mark method evidence)")
39
- return config
40
-
41
-
42
- def _open(store: Union[str, Any]):
43
- from ..ledger import ExperimentStore
44
- if isinstance(store, ExperimentStore):
45
- return store, False
46
- if isinstance(store, str):
47
- return ExperimentStore(store), True
48
- raise TypeError("store must be an ExperimentStore or a path to a ledger database")
49
-
50
-
51
- def record_report(report: DiscoveryReport, store: Union[str, Any]) -> Dict[str, Any]:
52
- from ..ledger import EventRecord, EvaluationStatus, ExperimentState
53
- st, owned = _open(store)
54
- try:
55
- fp = (report.profile.fingerprint or "unknown")[:16]
56
- rec = report.recommendation
57
- parent = st.create_experiment(
58
- task_env=f"discovery:{fp}", algorithm="discovery", framework="numpy", seed=report.seed,
59
- checkpoint_dir="",
60
- config=_check(jsonable({"role": "discovery", "domain": report.domain,
61
- "task": report.input_summary.get("task"),
62
- "metric": report.input_summary.get("metric"),
63
- "schema_version": report.schema_version})))
64
- pid = parent.experiment_id
65
- st.start_experiment(pid)
66
- trial_ids: Dict[str, str] = {}
67
- for x in report.experiments:
68
- if x.stage != "trial":
69
- continue
70
- child = st.create_experiment(
71
- task_env=f"discovery:{fp}", algorithm="discovery_trial", framework="numpy", seed=report.seed,
72
- checkpoint_dir="", parent_experiment_id=pid,
73
- config=_check(jsonable({"role": "discovery_trial", "family": x.family,
74
- "family_config": x.config, "metric": x.metric})))
75
- st.start_experiment(child.experiment_id)
76
- metrics = {f"cv_{x.metric}_mean": x.mean}
77
- if x.interval:
78
- metrics[f"cv_{x.metric}_lo"], metrics[f"cv_{x.metric}_hi"] = x.interval
79
- st.finalize_experiment(
80
- child.experiment_id,
81
- state=ExperimentState.COMPLETED if x.status == "ok" else ExperimentState.FAILED,
82
- evaluation_status=EvaluationStatus.PRELIMINARY,
83
- final_metrics={k: float(v) for k, v in metrics.items() if v is not None},
84
- error_message=x.error)
85
- trial_ids[x.key] = child.experiment_id
86
- seq = 0
87
-
88
- def emit(kind: str, payload: Dict[str, Any]) -> None:
89
- nonlocal seq
90
- st.append_event(pid, EventRecord(event_id=str(uuid.uuid4()), experiment_id=pid, sequence=seq,
91
- event_type=kind, source="discovery", payload=jsonable(payload),
92
- timestamp=time.time()))
93
- seq += 1
94
-
95
- emit("discovery.profile", {"meta_features": report.profile.sections.get("meta_features"),
96
- "fingerprint": report.profile.fingerprint,
97
- "n_total": report.profile.n_total, "n_sampled": report.profile.n_sampled})
98
- for f in report.findings:
99
- emit("discovery.finding", f.to_dict())
100
- emit("discovery.decision", {k: v.to_dict() for k, v in report.decisions().items()})
101
- emit("discovery.recommendation", rec.to_dict() if rec is not None else {})
102
- emit("discovery.budget", {"requested": report.budget_requested, "used": report.budget_used})
103
- final = {}
104
- if rec is not None and rec.expected_score is not None:
105
- final[f"holdout_{rec.metric}"] = float(rec.expected_score)
106
- st.finalize_experiment(pid, state=ExperimentState.COMPLETED, evaluation_status=EvaluationStatus.PRELIMINARY,
107
- final_metrics=final)
108
- return {"experiment_id": pid, "trials": trial_ids}
109
- finally:
110
- if owned:
111
- st.close()
1
+ """
2
+ Opt-in recording of a discovery run in the tensor-optix experiment ledger
3
+ (``discover(..., store=ExperimentStore(path) or path)``).
4
+
5
+ Layout (no ledger schema change -- plain experiments and events):
6
+ * one parent experiment: ``algorithm="discovery"``, ``task_env="discovery:<data fingerprint>"``,
7
+ ``config={"role": "discovery", ...}``;
8
+ * one child per family trial: ``algorithm="discovery_trial"``,
9
+ ``parent_experiment_id=<parent>``, ``config={"role": "discovery_trial", "family": ...,
10
+ "family_config": {...}}``, CV mean / interval in ``final_metrics``;
11
+ * parent events: ``discovery.profile`` (versioned meta-features), one ``discovery.finding``
12
+ per finding, ``discovery.decision`` (decisions at record time), ``discovery.recommendation``,
13
+ ``discovery.budget``.
14
+
15
+ Guardrails:
16
+ * records live under their own ``task_env`` namespace, so selectors that
17
+ query a task's history never see them;
18
+ * no config uses the keys the method selector treats as evidence
19
+ (``sampler``, ``op_name``, ``is_baseline``) -- checked before writing;
20
+ * ``best_primary_score`` is never set (discovery metrics are not all
21
+ higher-is-better); scores go to ``final_metrics`` with the metric name.
22
+ """
23
+ from __future__ import annotations
24
+
25
+ import time
26
+ import uuid
27
+ from typing import Any, Dict, Union
28
+
29
+ from .findings import jsonable
30
+ from .schema import DiscoveryReport
31
+
32
+ RESERVED_CONFIG_KEYS = ("sampler", "op_name", "is_baseline")
33
+
34
+
35
+ def _check(config: Dict[str, Any]) -> Dict[str, Any]:
36
+ bad = [k for k in RESERVED_CONFIG_KEYS if k in config]
37
+ if bad:
38
+ raise ValueError(f"discovery ledger config must not use {bad} (they mark method evidence)")
39
+ return config
40
+
41
+
42
+ def _open(store: Union[str, Any]):
43
+ from ..ledger import ExperimentStore
44
+ if isinstance(store, ExperimentStore):
45
+ return store, False
46
+ if isinstance(store, str):
47
+ return ExperimentStore(store), True
48
+ raise TypeError("store must be an ExperimentStore or a path to a ledger database")
49
+
50
+
51
+ def record_report(report: DiscoveryReport, store: Union[str, Any]) -> Dict[str, Any]:
52
+ from ..ledger import EventRecord, EvaluationStatus, ExperimentState
53
+ st, owned = _open(store)
54
+ try:
55
+ fp = (report.profile.fingerprint or "unknown")[:16]
56
+ rec = report.recommendation
57
+ parent = st.create_experiment(
58
+ task_env=f"discovery:{fp}", algorithm="discovery", framework="numpy", seed=report.seed,
59
+ checkpoint_dir="",
60
+ config=_check(jsonable({"role": "discovery", "domain": report.domain,
61
+ "task": report.input_summary.get("task"),
62
+ "metric": report.input_summary.get("metric"),
63
+ "schema_version": report.schema_version})))
64
+ pid = parent.experiment_id
65
+ st.start_experiment(pid)
66
+ trial_ids: Dict[str, str] = {}
67
+ for x in report.experiments:
68
+ if x.stage != "trial":
69
+ continue
70
+ child = st.create_experiment(
71
+ task_env=f"discovery:{fp}", algorithm="discovery_trial", framework="numpy", seed=report.seed,
72
+ checkpoint_dir="", parent_experiment_id=pid,
73
+ config=_check(jsonable({"role": "discovery_trial", "family": x.family,
74
+ "family_config": x.config, "metric": x.metric})))
75
+ st.start_experiment(child.experiment_id)
76
+ metrics = {f"cv_{x.metric}_mean": x.mean}
77
+ if x.interval:
78
+ metrics[f"cv_{x.metric}_lo"], metrics[f"cv_{x.metric}_hi"] = x.interval
79
+ st.finalize_experiment(
80
+ child.experiment_id,
81
+ state=ExperimentState.COMPLETED if x.status == "ok" else ExperimentState.FAILED,
82
+ evaluation_status=EvaluationStatus.PRELIMINARY,
83
+ final_metrics={k: float(v) for k, v in metrics.items() if v is not None},
84
+ error_message=x.error)
85
+ trial_ids[x.key] = child.experiment_id
86
+ seq = 0
87
+
88
+ def emit(kind: str, payload: Dict[str, Any]) -> None:
89
+ nonlocal seq
90
+ st.append_event(pid, EventRecord(event_id=str(uuid.uuid4()), experiment_id=pid, sequence=seq,
91
+ event_type=kind, source="discovery", payload=jsonable(payload),
92
+ timestamp=time.time()))
93
+ seq += 1
94
+
95
+ emit("discovery.profile", {"meta_features": report.profile.sections.get("meta_features"),
96
+ "fingerprint": report.profile.fingerprint,
97
+ "n_total": report.profile.n_total, "n_sampled": report.profile.n_sampled})
98
+ for f in report.findings:
99
+ emit("discovery.finding", f.to_dict())
100
+ emit("discovery.decision", {k: v.to_dict() for k, v in report.decisions().items()})
101
+ emit("discovery.recommendation", rec.to_dict() if rec is not None else {})
102
+ emit("discovery.budget", {"requested": report.budget_requested, "used": report.budget_used})
103
+ final = {}
104
+ if rec is not None and rec.expected_score is not None:
105
+ final[f"holdout_{rec.metric}"] = float(rec.expected_score)
106
+ st.finalize_experiment(pid, state=ExperimentState.COMPLETED, evaluation_status=EvaluationStatus.PRELIMINARY,
107
+ final_metrics=final)
108
+ return {"experiment_id": pid, "trials": trial_ids}
109
+ finally:
110
+ if owned:
111
+ st.close()