# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
"""Learn closure and stochastic dynamics from short microscopic observations."""
import sys
from math import exp
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]/"reference"))
from closure_demo import samples,train

theta,loss = train(samples(81,10))
print(f"closure residual coefficient {theta[0]:.2f}, fitted rotation {theta[3]:.2f}")
print(f"potential curvature {exp(theta[6]):.2f}")
print(f"noise amplitudes {exp(theta[4]):.2f}, {exp(theta[5]):.2f}")
