pykan
pykan copied to clipboard
Q: How to get a specific activation function's equation?
Hi,
for a trained model, is there any way to get the equation that defines the activation function (spline) for some specific connection?
Since we can get the plots, I would like to get the equation also, e.g., f(x) = ax +b for some linear activation functions, including a and b values.
Best,
This might be useful: https://kindxiaoming.github.io/pykan/API_demo/API_4_extract_activations.html
Also, function names are stored in model.symbolic_fun[l].funs_name
and coefficients are stored in model.symbolic_fun[l].affine
(l is the layer index)
Hi @KindXiaoming,
Many thanks and congratulations on this amazing work. Following up on this, I have been trying to understand the architecture of the network and I want to report an inconsistency (to the best of my understanding) between the paper and the implementation.
Please look at the screenshot from the paper below:
However, this is inconsistent with the implementation where a bias term is added to the summation of all outputs from the previous layer to represent the input to the next layer.
Here is a screenshot from the code:
I hope this helps.
Best wishes, Tanuj
hi, thank you for reporting this. yes, in the code the bias term is by default included, but I did not write them out since it can be absorbed into any activation functions. Bias terms are needed for sparsity regularization (without them, regularization seem to behave weird. But maybe there is a better way).