HadrienNU / better_kan

A mix of efficient-kan and pykan including plotting and pruning
4 stars 0 forks source link

NaN Values in A Matrix with Large Grid Size in curve2coeff #1

Closed Peter-sth closed 2 months ago

Peter-sth commented 2 months ago

Using the example program symbolic_regression.py as a reference: when the grid_size in build_splines_layers is set too large (e.g., 600), the A matrix in curve2coeff within layers.py results in NaN values, causing a calculation error. However, with the same grid_size value, the original efficient_kan can compute normally. I hope the author can address this issue in the next version.

HadrienNU commented 2 months ago

It does run for grid_size=600 in my computer. Could you provide more details? Did you use cuda or run the scipt on the cpu?

HadrienNU commented 2 months ago

You should try with sbasis_trainable=False option for build_splines_layers