KindXiaoming / pykan

Kolmogorov Arnold Networks
MIT License
14.33k stars 1.31k forks source link

Does it make sense to have multiple layers of KAN? #317

Closed SuperKogito closed 1 month ago

SuperKogito commented 1 month ago

Does this structure makes sense or can the KAN layers be optimised/ replaced with one KAN layer but with a higher grid_size/ spline_order?

self.layers = torch.nn.Sequential(
                                  torch.nn.Linear(input_size, 1024),
                                  torch.nn.ReLU(),                                            
                                  KAN([1024, 2048, 512],  grid_size=5, spline_order=5),
                                  KAN([512,  1024, 256],  grid_size=5, spline_order=9),
                                  KAN([256,   512, 128],  grid_size=10, spline_order=15),            
                                  KAN([128,   256, output_size], grid_size=5, spline_order=3)
                                  )
KindXiaoming commented 1 month ago

I'm not sure if your problem is so complicated that you need a model of this size. usually, spline_order (I guess you're using efficientKAN) should be <=3, otherwise this would lead to optimization issues.