KindXiaoming / pykan

Kolmogorov Arnold Networks
MIT License
14.71k stars 1.35k forks source link

a improve about Unsupervised learning #29

Closed blackwhite084 closed 2 months ago

blackwhite084 commented 5 months ago

I noticed that changing the seed in the example of unsupervised learning can lead to inaccurate results, and I found that the last layer function has become a quadratic function (Figure 4). I think the last layer function should remain a Gaussian function, so I added a feature called keep_fit

The effect is as follows

image

simple change: image

image

KindXiaoming commented 5 months ago

Hi, it is still Gaussian but just a part of it, so locally it looks like a quadratic function. The real problem with seed=55 looks like the regularization lamb is too large (for seed=55, although this penalty strength seems to work fine for other seeds). Please let me know decreasing lamb can solve your problem for seed=55.

KindXiaoming commented 5 months ago

Also, although the Gaussian function is fixed, the input and output affine transforations are learnable. By keep_fit, you make sure the affine transformations are always identity. Glad that you solved it, although I'm not sure if general users would find this feature useful. And please try the regularization trick I mentioned above and let me know how that works :).

KindXiaoming commented 5 months ago

I see that you have a bool keep_fit, that sounds reasonable. If you want, you can do a PR (please set keep_fit=False by default since it will slow down things a bit I guess).