gitmyhub

pykan

Jupyter Notebook ★ 16k updated 1y ago

Kolmogorov Arnold Networks

A Python library implementing Kolmogorov-Arnold Networks, a new type of neural network that is more interpretable than standard architectures, designed for scientific and mathematical problems.

PythonPyTorchnumpyscikit-learnmatplotlibsympysetup: moderatecomplexity 4/5

pykan is a Python library that implements Kolmogorov-Arnold Networks, or KANs — a type of neural network designed as an alternative to Multi-Layer Perceptrons, the standard architecture most modern AI is built on. It accompanies two research papers titled "KAN: Kolmogorov-Arnold Networks" and "KAN 2.0: Kolmogorov-Arnold Networks Meet Science."

The core difference, in plain terms, is where the network does its computation. MLPs put their activation functions on the network's nodes (the circles in a diagram), while KANs put them on the edges (the lines connecting the circles). According to the authors, this small structural change often makes the resulting models more accurate and easier for humans to interpret — meaning you can look at a trained model and understand what mathematical relationship it has learned. KANs are grounded in the Kolmogorov-Arnold representation theorem, a theoretical foundation comparable to the universal approximation theorem behind MLPs.

You would reach for this library if you are researching neural networks, working on small-to-medium scientific or mathematical problems such as fitting functions or solving partial differential equations, or specifically want a model whose internal logic can be inspected and simplified through pruning and symbolic regression. The bundled examples are typically runnable on a single CPU in under ten minutes, with PDE training taking longer.

The library is written in Python and built on the PyTorch deep-learning framework, alongside numpy, scikit-learn, matplotlib and sympy. It installs via pip or directly from GitHub. The full README is longer than what was provided.

Where it fits