pykan icon indicating copy to clipboard operation
pykan copied to clipboard

A question about model.plot() method

Open avasyukhin opened this issue 9 months ago • 6 comments

When I run examples of code (like from hellokan) method model.plot() didn't plot figures (however parts of it saved inside .figures) but matplotlib running in the same environment produce figures correctly.

avasyukhin avatar May 04 '24 15:05 avasyukhin

When I run examples of code (like from hellokan) method model.plot() didn't plot figures (however parts of it saved inside .figures) but matplotlib running in the same environment produce figures correctly.

I am having the same issue. Only activation function figures are saved as separate images inside the figures folder. I cannot see the whole plot anywhere. How can I plot that?

ChamodDamitha avatar May 09 '24 03:05 ChamodDamitha

Could be a problem of matplotlib version. It is suggested to use matplotlib==3.6.2

KindXiaoming avatar May 09 '24 10:05 KindXiaoming

I have similar problem with matplotlib==3.6.2'.I upgraded to3.8.4` and I have this same. But I using terminal environment. When I use notebook/google collab this same code works correctly and save whole figure.

mkrzywda avatar May 09 '24 13:05 mkrzywda

I could solve the issue by adding plt.show() to the end of plot() method in KAN class. This is why it's only working in notebooks. You can call savefig() here as well to save to the file.

ChamodDamitha avatar May 10 '24 00:05 ChamodDamitha

I think we should add this method call for more consistent behavior in both local and collab environments.

avasyukhin avatar May 12 '24 06:05 avasyukhin

Yes, this should be definitely added to.

mkrzywda avatar May 15 '24 08:05 mkrzywda