pykan icon indicating copy to clipboard operation
pykan copied to clipboard

Symbolic formula is incorrect when using multiplication nodes with mult_arity=4

Open chbardel opened this issue 6 months ago • 2 comments

It seems the formula construction does not yet consider the different multarity cases correctly. My KAN is: width=[5,[1,2],1] mult_arity=4 grid=8 k=3

I started looking into the code of the MultKAN.symbolic_formula() function and compared it against the code in the MultKAN.forward(). Too me the handling of multiplication looks a lot more sophisticated in the forward pass and quite different from how its handled in the symbolic formula construction. I see a fixed stride length of two in the latter, which seems to suggest it does not handle the cases in which 4 nodes are multiplied with each other.

End result is that the formula, when applied to the inputs, gives a result different from the forward pass, although everything is set to fully symbolic mode.

If any further details are needed, like a full copy of the model, please let me know.

chbardel avatar Aug 13 '24 14:08 chbardel