explaingit

kindxiaoming/pykan

16,273Jupyter NotebookAudience · researcherComplexity · 4/5Setup · moderate

TLDR

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.

Mindmap

mindmap
  root((repo))
    What it does
      KAN neural networks
      Interpretable models
      Research library
    Tech stack
      Python
      PyTorch
      NumPy
      SymPy
    Use cases
      Function fitting
      PDE solving
      Symbolic regression
    Compared to MLPs
      Edges not nodes
      More interpretable
      Prunable models
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Fit a mathematical function to a dataset and extract the learned formula in human-readable symbolic form.

USE CASE 2

Solve partial differential equations with a neural network whose internal logic can be inspected and simplified.

USE CASE 3

Research and compare KAN architecture performance against standard MLPs on a small regression task.

Tech stack

PythonPyTorchnumpyscikit-learnmatplotlibsympy

Getting it running

Difficulty · moderate Time to first run · 30min

Requires PyTorch, PDE training examples can take significant time on CPU without a GPU.

In plain English

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.

Copy-paste prompts

Prompt 1
Train a pykan Kolmogorov-Arnold Network to fit sin(x) and then extract the symbolic formula it learned, show me the full code.
Prompt 2
Show me how to prune a pykan model to simplify it and apply symbolic regression to get a readable equation from the result.
Prompt 3
Set up pykan and run the basic tutorial notebook on CPU to compare a KAN against an MLP on a small dataset.
Prompt 4
How do I use pykan to solve a 2D partial differential equation and visualize the learned solution?
Prompt 5
What hyperparameters in pykan control the grid size and spline order, and how do they affect accuracy vs interpretability?
Open on GitHub → Explain another repo

← kindxiaoming on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.