Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

symbolic formula changes after forward pass #508

Open
CyrillStrassburg opened this issue Dec 31, 2024 · 0 comments
Open

symbolic formula changes after forward pass #508

CyrillStrassburg opened this issue Dec 31, 2024 · 0 comments

Comments

@CyrillStrassburg
Copy link

CyrillStrassburg commented Dec 31, 2024

Hello, first of all, Thank you for your work! I am using KANs to model environmental data and have high hopes.
When training and pruning my KAN i would like to produce metrics and for this i forward pass the test set of my data. While doing this, I noticed that the output of auto_symbolic() changes depending on the last forward pass while everything else stays the same. Why is this? Do forward passes change the model? If so, why?

Is there a resource i can consult to better understand the code for getting the symbolic formulas?

The behavior is reproducible with the hellokan.ipynb from the pykan repo when changing train and test data to my dataset. Depending on whether a prediction is made using a random tensor model(torch.rand(...)) before calling model.auto_symbolic(), different formulas are produced. I tried setting the model to evaluation mode and calling torch.no_grad() before passing the random tensor but it had no effect on the behavior.

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

No branches or pull requests

1 participant