ZiyaoLi/fast-kan
소개
FastKAN: Kolmogorov-Arnold 네트워크(KAN)의 초고속 구현
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalFastKAN: Very Fast Kolmogorov-Arnold Network via Radial Basis Functions
Introduction
This repository contains a very fast implementation of the Kolmogorov-Arnold Network (KAN), by replacing the 3-order B-spline basis in the original KANs with Radial Basis Functions (RBFs).
The forward time of FaskKAN is 3.33x faster than efficient KAN, and the implementation is a LOT easier.
The original implementation of KAN is pykan.
Installation
One can install fast-kan via pip:
git clone https://github.com/ZiyaoLi/fast-kan
cd fast-kan
pip install .
Run an example training of the FastKAN network on MNIST:
python examples/train_mnist.py
What FastKAN Does
- Uses Gaussian Radial Basis Functions to approximate the B-spline basis, which is the bottleneck of KAN and efficient KAN:
$$b_{i}(u)=\exp\left(-\left(\frac{u-u_i}{h}\right)^2\right)$$
The rationale for doing so is that these RBF functions well approximate the B-spline basis (up to a linear transformation) and are very easy to calculate (as long as the grids are uniform). Results are shown in the figure below (code in notebook).

Uses LayerNorm to scale inputs to the range of spline grids, so there is no need to adjust the grids.
FastKAN is 3.33x compared with efficient_kan in forward speed. (see notebook, 742us -> 223us on V100)
Accuracy on MNIST is equivalent / slightly improved.

- More importantly, the approximation made in FastKAN suggests that KAN is equivalent to a certain RBF Network. This finding bridges between RBF Networks and KANs.
Plot the learned curves
FastKANLayer supports users in plotting the learned curves dim-by-dim. See notebook for an example of usage.
Cite This Work
Copyright 2024 Li, Ziyao. Licensed under the Apache License, Version 2.0.
@article{li2024kolmogorovarnold,
title={Kolmogorov-Arnold Networks are Radial Basis Function Networks},
author={Ziyao Li},
year={2024},
eprint={2405.06721},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
관련 프로젝트 살펴보기
불러오는 중…