Replies: 3 comments 1 reply
-
Hi everyone, I'm new to PySR and I'm also interested in introducing specific expressions into the initial population. I saw the previous discussion on this topic, but I’m hoping for an easier way to do it or any new insights. Any guidance would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
@riccardocappi now there is sort of an easier way to do it via template expressions: expression_spec = TemplateExpressionSpec(
expressions=["f", "g"],
parameters={"a": 1},
variable_names=["x"],
combine="""
y1 = (x + f(x))^2 + 1 + a[1]
y2 = exp((x + f(x))/10)/(5 + a[1])
g(x, y1, y2)
"""
)
model = PySRRegressor(expression_spec=expression_spec, **kwargs) Basically this is creating a hierarchical expression where So this model could choose to have But it could also learn something like it could also learn something entirely different like But you can see how it is "easier" for the model to find something like @AKHCE's original suggested expressions; while still allowing the model to learn something arbitrary. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am wondering if we can tell pysr that include specific expressions in the inital population. E.g. assume : I know that three expressions
y=x1**2+1
,y=x**1.5+2
, andy=exp(x1/10)/5
could kinda be close to the final solution, and I am interested that pysr includes these specific epxressions in the initial population. Is there any built-in feature in pysr to address such a request?Any advice is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions