Skip to content

dx111ge/emlMath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EML Symbolic Regression — Differentiable Tree Experiment

Self-measurement of one specific consequence of Odrzywolek (2026), "All elementary functions from a single operator" (arXiv:2603.21852). The paper claims the binary operator

eml(x, y) = exp(x) - ln(y)

together with the constant 1 suffices to express the standard scientific calculator vocabulary.

This repo tests one practical claim that follows from the structure: because EML trees have a single operator class, the discrete leaf choice can be replaced by a Softmax mixture over {x, 1}, making the whole tree continuously parameterised. That in turn means classical genetic symbolic regression can be replaced by ordinary gradient descent over the leaves.

The app does not validate that this is a good idea — it measures where it breaks.

What the experiment does

A full binary EML tree of fixed depth d is built. Each of its 2^d leaves holds a logits vector over {x, 1}; a Softmax over the logits gives a continuous mixture which is fed bottom-up through the deterministic eml(left, right) = exp(left) - ln(right) operator. MSE against a target function is minimised with Adam.

Two modes:

  • Einzelner Run. One depth, one seed. Plots loss curve, reports final loss, prints the learned tree as a nested eml(...) expression (argmax over leaf logits).
  • Sweep alle Tiefen. Depths 2..8, 10 seeds each. Aggregates three metrics: depth vs. success rate, depth vs. mean final loss (with std band), depth vs. NaN/Inf rate.

Setup

Python 3.10+. Install dependencies:

pip install -r requirements.txt

Run:

streamlit run app.py

Fixed experimental parameters

These are pinned in code (not exposed beyond the slider limits noted) to avoid post-hoc cherry-picking:

Parameter Value
Depth range (sweep) 2..8
Iterations (default) 2000
Optimizer Adam, lr = 0.05
Sweep runs per depth 10
Success threshold final loss < 1e-3
Datapoints 50, x in [0.5, 2.0]
Leaf symbols {x, 1}
Targets 2x + 1, x^2, x^2 + 1
ln-guard clamp(min=1e-8) before ln only

exp overflow to inf is not clamped. NaN/Inf is the measurement, not a bug to silence.

Pre-registered hypotheses

These are documented before the experiment so the result cannot be rationalised after the fact:

  • A — Convergence failure with growing depth. Number of leaves grows as 2^d. Loss landscape becomes rugged. Expected: clean convergence up to depth 3-4, then increasing seed-to-seed variance.
  • B — Numerical instability. Nested exp / ln accumulates float64 error. Expected: non-trivial NaN/Inf fraction at depth 6+.
  • C — Open question. Which failure mode dominates first? Unknown. That is the actual measurement.

The app does not check any of these. It runs the configured measurement.

Out of scope (sprint discipline)

  • Per-depth optimiser tuning
  • Symbol sets beyond {x, 1}
  • Multivariate targets
  • Tree topologies other than full binary
  • Hyperparameter search
  • Graph visualisation of the tree (text expression only)
  • Comparison against classical genetic symbolic regression
  • Streamlit Cloud deployment

Files

  • app.py — Streamlit UI (single-run + sweep modes, plotting)
  • eml_core.pyEMLTree model, train_one_run, tree_to_string, target-function table, numerical-guard constants
  • requirements.txt — Python dependencies

References

  • Odrzywolek, "All elementary functions from a single operator", arXiv:2603.21852 (April 2026)
  • Stylewarning, "Not all elementary functions can be expressed with exp-minus-log" — substantive critique of completeness
  • Cook, "The smallest math library", johndcook.com (2026-04-13) — NN angle

About

Pre-registered experiment on differentiable EML-tree symbolic regression (Odrzywolek 2026, arXiv:2603.21852). Streamlit UI + headless reproducer + full results.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages