Jump to content

The Principia Machina/Tools/PySR: Difference between revisions

From The Invariance Itself
m 1 revision imported
Formulas written for the wiki's math renderer: 1 $$..$$ and 7 $..$ as <math>, 4 numbered lines as # items; no other text changed (tpm_tools 0.1.0)
Line 3: Line 3:


== Overview & Architectural Fit ==
== Overview & Architectural Fit ==
'''PySR''' (interfaced via Python to the high-performance Julia backend '''SymbolicRegression.jl''') is an open-source symbolic regression framework utilizing Multi-Population Genetic Algorithms and Pareto Frontier optimization. In the [[The Principia Machina|Principia Machina]] architecture, PySR addresses the inverse theoretical problem: given a field dataset or trajectory simulation, what analytical scalar expression or Lagrangian density $\mathcal{L}(q, \dot{q}, t)$ or $\mathcal{L}(\phi, \partial_\mu \phi)$ governs the system?
'''PySR''' (interfaced via Python to the high-performance Julia backend '''SymbolicRegression.jl''') is an open-source symbolic regression framework utilizing Multi-Population Genetic Algorithms and Pareto Frontier optimization. In the [[The Principia Machina|Principia Machina]] architecture, PySR addresses the inverse theoretical problem: given a field dataset or trajectory simulation, what analytical scalar expression or Lagrangian density <math>\mathcal{L}(q, \dot{q}, t)</math> or <math>\mathcal{L}(\phi, \partial_\mu \phi)</math> governs the system?


== Mathematical Evaluation for TPM & SVD ==
== Mathematical Evaluation for TPM & SVD ==
* '''Lagrangian & Action Discovery (9.5/10):''' PySR can search candidate functional spaces for invariant quantities. By setting loss functions to penalize violations of Euler-Lagrange dynamics or Hamilton's principle ($\delta S = 0$), PySR directly extracts analytical scalar Lagrangians from observational state trajectories.
* '''Lagrangian & Action Discovery (9.5/10):''' PySR can search candidate functional spaces for invariant quantities. By setting loss functions to penalize violations of Euler-Lagrange dynamics or Hamilton's principle (<math>\delta S = 0</math>), PySR directly extracts analytical scalar Lagrangians from observational state trajectories.
* '''Pareto Complexity Optimization:''' Automatically balances accuracy against expression complexity using score metrics:
* '''Pareto Complexity Optimization:''' Automatically balances accuracy against expression complexity using score metrics:
$$\text{Score} = -\frac{\Delta \log(\text{MSE})}{\Delta \text{Complexity}}$$
<math display="block">\text{Score} = -\frac{\Delta \log(\text{MSE})}{\Delta \text{Complexity}}</math>
This directly prevents the discovery of unphysical "overfitted" mathematical artifacts.
This directly prevents the discovery of unphysical "overfitted" mathematical artifacts.
* '''Custom Operator Ingestion:''' Supports specialized physical operators (e.g., spatial gradients $\nabla \phi$, d'Alembertian operators $\Box \phi$, or relativistic dot products $u^\mu u_\mu$).
* '''Custom Operator Ingestion:''' Supports specialized physical operators (e.g., spatial gradients <math>\nabla \phi</math>, d'Alembertian operators <math>\Box \phi</math>, or relativistic dot products <math>u^\mu u_\mu</math>).


== SVD Integration Pipeline ==
== SVD Integration Pipeline ==
1. '''Data Generation:''' Extract spatial perturbation profiles from vacuum disturbance simulations.
# '''Data Generation:''' Extract spatial perturbation profiles from vacuum disturbance simulations.
2. '''Operator Set Specification:''' Define admissible operators $\{+, -, \times, \div, \nabla, \partial_t, \text{exp}\}$.
# '''Operator Set Specification:''' Define admissible operators <math>\{+, -, \times, \div, \nabla, \partial_t, \text{exp}\}</math>.
3. '''Variational Loss Enforcement:''' Evaluate candidates against action stationarity constraints.
# '''Variational Loss Enforcement:''' Evaluate candidates against action stationarity constraints.
4. '''Analytical Verification:''' Pass discovered symbolic candidate expressions to [[The Principia Machina/Tools/Cadabra2|Cadabra2]] for formal Noether symmetry evaluation.
# '''Analytical Verification:''' Pass discovered symbolic candidate expressions to [[The Principia Machina/Tools/Cadabra2|Cadabra2]] for formal Noether symmetry evaluation.



Revision as of 00:59, 6 October 2026

PySR / SymbolicRegression.jl: High-Performance Symbolic Discovery

Overview & Architectural Fit

PySR (interfaced via Python to the high-performance Julia backend SymbolicRegression.jl) is an open-source symbolic regression framework utilizing Multi-Population Genetic Algorithms and Pareto Frontier optimization. In the Principia Machina architecture, PySR addresses the inverse theoretical problem: given a field dataset or trajectory simulation, what analytical scalar expression or Lagrangian density ℒ(q,q˙,t) or ℒ(ϕ,∂μϕ) governs the system?

Mathematical Evaluation for TPM & SVD

  • Lagrangian & Action Discovery (9.5/10): PySR can search candidate functional spaces for invariant quantities. By setting loss functions to penalize violations of Euler-Lagrange dynamics or Hamilton's principle (δS=0), PySR directly extracts analytical scalar Lagrangians from observational state trajectories.
  • Pareto Complexity Optimization: Automatically balances accuracy against expression complexity using score metrics:

Score=−Δlog⁡(MSE)ΔComplexity This directly prevents the discovery of unphysical "overfitted" mathematical artifacts.

  • Custom Operator Ingestion: Supports specialized physical operators (e.g., spatial gradients ∇ϕ, d'Alembertian operators ◻ϕ, or relativistic dot products uμuμ).

SVD Integration Pipeline

  1. Data Generation: Extract spatial perturbation profiles from vacuum disturbance simulations.
  2. Operator Set Specification: Define admissible operators {+,−,×,÷,∇,∂t,exp}.
  3. Variational Loss Enforcement: Evaluate candidates against action stationarity constraints.
  4. Analytical Verification: Pass discovered symbolic candidate expressions to Cadabra2 for formal Noether symmetry evaluation.