Blealtan / efficient-kan

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

need long time to init efficient-KAN #53

Open TuuSiwei opened 2 weeks ago

TuuSiwei commented 2 weeks ago

When I initialize efficient KAN with a high number of nodes, I have to wait a long time

my test code is as follows:

from kan import KAN
import time

start_time=time.time()
model=KAN([1024,3584,3584])
print(f'Initialization time: {time.time()-start_time}')

and the output is:

Initialization time: 330.3829219341278

Why does it take so long to initialize

TuuSiwei commented 2 weeks ago

After a single step, I found that the problem came from the curve2coeff function's torch.linalg.lstsq(), which was taking an enormous amount of time