What's Changed
- Expanded support for differential operators via backend 1.5.0 by @MilesCranmer in #782
e.g., say we wish to integrate
import numpy as np
from pysr import PySRRegressor, TemplateExpressionSpec
x = np.random.uniform(1, 10, (1000,)) # Integrand sampling points
y = 1 / (x**2 * np.sqrt(x**2 - 1)) # Evaluation of the integrand
expression_spec = TemplateExpressionSpec(
["f"], "((; f), (x,)) -> D(f, 1)(x)"
)
model = PySRRegressor(
binary_operators=["+", "-", "*", "/"],
unary_operators=["sqrt"],
expression_spec=expression_spec,
maxsize=20,
)
model.fit(x[:, np.newaxis], y)
which should correctly find
Full Changelog: v1.2.0...v1.3.0