Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Something different from the official results for KAN. #38

Open
ASCIIJK opened this issue May 23, 2024 · 1 comment
Open

Something different from the official results for KAN. #38

ASCIIJK opened this issue May 23, 2024 · 1 comment

Comments

@ASCIIJK
Copy link

ASCIIJK commented May 23, 2024

I try to reproduce the experiments (example 4 in official KAN). With official KAN, I get the results as below (Ground-truth is at the top, and the predication is at the bottom):
Ground_task5
Pred_task4

But with the efficient-kan, I get the results as below:
Ground_task5
Pred_task4

It shows that previous peak will be higher when learning new peak.
The official model is create by: "model = KAN(width=[1, 1], grid=200, k=3, noise_scale=0.1, bias_trainable=False, sp_trainable=False, sb_trainable=False)"
The efficient-kan model is created by: "model = KAN([1, 1], grid_size=200)"
It seems to be the same except for "bias_trainable=False, sp_trainable=False, sb_trainable=False".

@MrPio
Copy link

MrPio commented Aug 1, 2024

Hi ASCIIJK! I was very interested in your comment and tried to play a bit with the EfficientKAN code.

When I replicated the 7th PyKAN regression example with EfficientKAN, I got results similar to yours.

However, as you said, the sb_trainable and sp_trainable parameters seem to be missing in the constructor, so I decided to add them, just like PyKAN does.

immagine
As you can see, I use them to disable the trainability of the base_weight and splin_weight parameters.

After training with the configuration

KAN([1, 1],
        grid_size=200,
        grid_eps=1,
        scale_base=0,
        sp_trainable=False,
        sb_trainable=False,
)

with 100 epochs for each peak as shown in the 8th PyKAN regression example, I got the following result:

GaussianPeaksEfficientKAN

You can read my training code here: Is_EfficientKAN_good.ipynb,
and how I edited the EfficientKAN class here: kan.py

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants