Closed leoq276 closed 4 months ago
Hi, please change
f = lambda x: x[:,0] + x[:,1]
to
f = lambda x: x[:,[0]] + x[:,[1]]
. I apologize this could be a bit confusing.
Thank you so much! It turns out using f = lambda x: x[:,0] + x[:,1]
creates the label with shape [1000]
and f = lambda x: x[:,[0]] + x[:,[1]]
creates the label with shape [1000, 1]
.
I tested how well KAN fits some simple functions and found that in some cases the training and testing losses do not decrease.
For example:
This is also true for
f = lambda x: torch.sqrt(x[:,0]**2 + x[:,1]**2)
,f = lambda x: x[:,0]**2 + x[:,1]**2
and some other cases.I have tried to change some of the parameters ,including
width
,grid
,opt
,lr
, 'lamb,
lamb_l1` but it didn't work.