Skip to content

Commit

Permalink
KAG with learnable grids is added (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
cometscome committed Jun 3, 2024
1 parent 5b37090 commit 8caa6a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ In addition, I implemented Chebyshev polynomials in KAN.
- KAC-Net: Utilizing Chebyshev Polynomials in Kolmogorov Arnold Chebyshev Networks

I implemented the Gaussian Radial Basis Functions introduced in [fastkan](https://github.com/ZiyaoLi/fast-kan):
- KAG-Net: Utilizing Gaussian radial basis functions in Kolmogorov Arnold Gaussian Networks
- KAG-Net: Utilizing Gaussian radial basis functions in Kolmogorov Arnold Gaussian Networks (non-trainable grids)
- KAGL-Net: (Experimental) Utilizing Gaussian radial basis functions in Kolmogorov Arnold Gaussian Networks (trainable grids)

# install
```
Expand Down Expand Up @@ -52,6 +53,8 @@ model = Chain(KAGnet(2, 10, num_grids=4), KAGnet(10, 1, num_grids=4))
```
In the KAGnet, the grid points are fixed.

I implemented the Gaussian function with learnable grid points. But this is experimental. You can use ```KAGLnet```.

# MNIST

```julia
Expand Down
5 changes: 5 additions & 0 deletions src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ function MNIST_KAN(; batch_size=256, epochs=20, nhidden=64, polynomial_order=3,
KAGnet(input_size, nn; num_grids=polynomial_order + 1),
KAGnet(nn, nclasses; num_grids=polynomial_order + 1)
)
elseif method == "GaussianLearnable"
model = Chain(
KAGLnet(input_size, nn; num_grids=polynomial_order + 1),
KAGLnet(nn, nclasses; num_grids=polynomial_order + 1)
)
else
error("method = $medhod is not supported")
end
Expand Down

0 comments on commit 8caa6a2

Please sign in to comment.