https://github.com/KindXiaoming/pykan Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} KindXiaoming / pykan Public * Notifications * Fork 48 * Star 898 * Kolmogorov Arnold Networks License MIT license 898 stars 48 forks Branches Tags Activity Star Notifications * Code * Issues 8 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights KindXiaoming/pykan This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 111 Commits .github/workflows .github/workflows .ipynb_checkpoints .ipynb_checkpoints docs docs kan kan pykan.egg-info pykan.egg-info tutorials tutorials .gitignore .gitignore LICENSE LICENSE README.md README.md hellokan.ipynb hellokan.ipynb requirements.txt requirements.txt setup.py setup.py View all files Repository files navigation * README * MIT license kan_plot Kolmogorov-Arnold Networks (KANs) This is the github repo for the paper "KAN: Kolmogorov-Arnold Networks". Find the documentation here. Kolmogorov-Arnold Networks (KANs) are promising alternatives of Multi-Layer Perceptrons (MLPs). KANs have strong mathematical foundations just like MLPs: MLPs are based on the universal approximation theorem, while KANs are based on Kolmogorov-Arnold representation theorem. KANs and MLPs are dual: KANs have activation functions on edges, while MLPs have activation functions on nodes. This simple change makes KANs better (sometimes much better!) than MLPs in terms of both model accuracy and interpretability. A quick intro of KANs here. mlp_kan_compare Accuracy KANs have faster scaling than MLPs. KANs have better accuracy than MLPs with fewer parameters. Example 1: fitting symbolic formulas Screenshot 2024-04-30 at 10 55 30 Example 2: fitting special functions Screenshot 2024-04-30 at 11 07 20 Example 3: PDE solving Screenshot 2024-04-30 at 10 57 25 Example 4: avoid catastrophic forgetting Screenshot 2024-04-30 at 11 04 36 Interpretability KANs can be intuitively visualized. KANs offer interpretability and interactivity that MLPs cannot provide. We can use KANs to potentially discover new scientific laws. Example 1: Symbolic formulas Screenshot 2024-04-30 at 11 04 56 Example 2: Discovering mathematical laws of knots Screenshot 2024-04-30 at 11 05 25 Example 3: Discovering physical laws of Anderson localization Screenshot 2024-04-30 at 11 05 53 Example 4: Training of a three-layer KAN kan_training_low_res Installation There are two ways to install pykan, through pypi or github. Installation via github git clone https://github.com/KindXiaoming/pykan.git cd pykan pip install -e . Installation via pypi pip install pykan Requirements # python==3.9.7 matplotlib==3.6.2 numpy==1.24.4 scikit_learn==1.1.3 setuptools==65.5.0 sympy==1.11.1 torch==2.2.2 tqdm==4.66.2 To install requirements: pip install -r requirements.txt Computation requirements Examples in tutorials are runnable on a single CPU typically less than 10 minutes. All examples in the paper are runnable on a single CPU in less than one day. Training KANs for PDE is the most expensive and may take hours to days on a single CPU. We use CPUs to train our models because we carried out parameter sweeps (both for MLPs and KANs) to obtain Pareto Frontiers. There are thousands of small models which is why we use CPUs rather than GPUs. Admittedly, our problem scales are smaller than typical machine learning tasks, but are typical for science-related tasks. In case the scale of your task is large, it is advisable to use GPUs. Documentation The documentation can be found here. Tutorials Quickstart Get started with hellokan.ipynb notebook. More demos More Notebook tutorials can be found in tutorials. Citation @misc{liu2024kan, title={KAN: Kolmogorov-Arnold Networks}, author={Ziming Liu and Yixuan Wang and Sachin Vaidya and Fabian Ruehle and James Halverson and Marin Soljacic and Thomas Y. Hou and Max Tegmark}, year={2024}, eprint={2404.19756}, archivePrefix={arXiv}, primaryClass={cs.LG} } Contact If you have any questions, please contact zmliu@mit.edu About Kolmogorov Arnold Networks Resources Readme License MIT license Activity Stars 898 stars Watchers 12 watching Forks 48 forks Report repository Releases 2 v0.0.2 Latest Apr 29, 2024 + 1 release Packages 0 No packages published Contributors 5 * * * * * Languages * Jupyter Notebook 97.4% * Python 2.6% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.