pykan icon indicating copy to clipboard operation
pykan copied to clipboard

a improve about Unsupervised learning

Open blackwhite084 opened this issue 9 months ago • 3 comments

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

blackwhite084 avatar May 02 '24 17:05 blackwhite084

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 avatar May 02 '24 17:05 KindXiaoming

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 avatar May 02 '24 17:05 KindXiaoming

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).

KindXiaoming avatar May 02 '24 17:05 KindXiaoming