Blealtan / efficient-kan

An efficient pure-PyTorch implementation of Kolmogorov-Arnold Network (KAN).
MIT License
3.49k stars 306 forks source link

What is the mathematic equation behind the model? #16

Closed hoangthangta closed 1 month ago

hoangthangta commented 1 month ago

I wonder what the equation used in the KAN model, anybody knows?

karlo-con-k commented 1 month ago

From what I understand, conventional neural network models are based on the Universal Approximation Theorem. However, KAN is based on the Kolmogorov-Arnol Representation Theorem. I'm not sure if that answers your question :D

hoangthangta commented 1 month ago

We may know that KAN uses math equations (instead of variables) to fit the data points. However, what type of math equation (abs, sin, cos, etc) does this package use? It may use curve2coeff (compute the coefficients of the curve that interpolates the given points) to solve the equation (numpy.linalg.lstsq, a @ x = b). I am not sure but it is correct since the authors does not give much information about math equations.

minh-nguyenhoang commented 1 month ago

I think the author still use b-spline, but just compute them in a more efficient way.

However, all activation functions are linear combination of a fixed set of basis functions which are B-splines; given that, we can reformulate the computation as activate the input with different basis functions and then combine them linearly.

Blealtan commented 1 month ago

Please refer to the original paper. I'm just reproducing it in a more computationally efficient way. The only change is in the sparsification loss term which seems not really critical to applications other than symbolic regression; if I get the time I will write on that one.