KindXiaoming / pykan

Kolmogorov Arnold Networks
MIT License
15.1k stars 1.4k forks source link

Kanpiler not compiling this simple expression #463

Open simonnanty opened 2 months ago

simonnanty commented 2 months ago

Hello Ziming, thank you very much for turning these great papers into open source python code!

I am trying to "kanpile" this expression:

expr = sympy.trigsimp("exp(- x_1 / 100) - exp(- (x_1 + 1) / 100)")

i.e. $e^{-x_1/100} - e^{-(x_1+1)/100}$.

However, the kanpiler does not manage to convert it. When running this code model = kanpiler(sympy.symbols(["x_1"]), expr), it gives the following expression: $exp(-0.01x_1)$, which is only half of the original one.

Is it a bug? What can I do to mitigate this issue?

Thank you

image