Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Rediscovered Kepler's Third Law on a Phone, in 204 Lines

说明与用途

一个在 Android 手机上运行的 204 行 Python 符号回归引擎,在 11 毫秒内重新发现了开普勒第三定律。

问题

Most machine‑learning models are black boxes; for physics, biology, or finance one needs interpretable laws rather than predictions.

结果

The engine successfully rediscovered y=x*sin(x) and T=a^(3/2) (Kepler’s Third Law) from numeric data, achieving MSEs of 5.36e-33 and 4.77e-31 in 18 ms and 11 ms respectively, on an Android phone.

工作流

  • Build a library of candidate forms for each input variable (x, x^2, x^3, 1/x, 1/x^2, sqrt(x), sin(x), cos(x), exp(-x), log(x)).
  • Generate all pairwise products of candidate forms, yielding ~55 forms.
  • Apply Orthogonal Matching Pursuit (OMP) in pure NumPy to select the smallest subset of columns that best reconstructs the target, testing k=1..6 and keeping the best MSE.
  • Combine selected terms into a SymPy expression and simplify to obtain the final symbolic formula.

证据

The engine rediscovered it, from raw numbers, in 11 milliseconds, on an Android phone.

来源

Two targets didn't work. Newton's law of gravitation (F = m1*m2/r^2): MSE 1.6. Reason: the library only generates pairwise products.

来源

pip install numpy sympy rich
python flash.py kepler

来源

  • 记录日期: 2026-10-04T12:41:04.699Z