Uni-KAN
English / 简体中文
This is a Python library based on PyTorch for universally building KAN-type networks. Universal KAN-type networks is named Uni-KAN.
Installation
pip install unikan
Features
- Framework for building Universal KAN type network (uni-kan)
- SKAN (Single-Parameterized KAN) implementation
- Contain pre defined basis functions in SKAN
- Pytorch compatible (GPU acceleration, etc.)
Quick Start
Universal KAN Example
from unikan import UniversalKAN
import unikan.basis as basis
# Define node configurations for each layer
function_lists = [
[
{'function': basis.lshifted_softplus, 'param_num': 1,
'node_type': 'add', 'node_num': 90, 'use_bias': True},
{'function': basis.lshifted_softplus, 'param_num': 1,
'node_type': 'mul', 'node_num': 10, 'use_bias': True}
],
[
{'function': basis.lshifted_softplus, 'param_num': 1,
'node_type': 'add', 'node_num': 10, 'use_bias': True}
]
]
# Create universal KAN network
net = UniversalKAN([784, 100, 10], # layer sizes
function_lists=function_lists, # node configs
device=device) # device selection
SKAN Example
import torch
from unikan import SKAN_pure
import unikan.basis as basis
# Create SKAN network
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
net = SKAN_pure([784, 100, 10], # layer sizes: input 784, hidden 100, output 10
basis_function=basis.lshifted_softplus, # basis function
device=device) # device selection
License
MIT License
Citation
If you use this project in your research, please cite:
@misc{chen2024lssskanefficientkolmogorovarnoldnetworks,
title={LSS-SKAN: Efficient Kolmogorov-Arnold Networks based on Single-Parameterized Function},
author={Zhijie Chen and Xinglin Zhang},
year={2024},
eprint={2410.14951},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2410.14951},
}
Contact
- Email: zhijiechencs@gmail.com
Release files for unikan 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unikan-0.2.5.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unikan-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.4 kB
Release files / unikan-0.2.5.tar.gz
| Download URL | unikan-0.2.5.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5995203fe36170110cbbc6c7131d193d5cf30a2fa9efc3f56150fe09e2da4311
|
|
BLAKE2b-256 checksum How to use checksums |
abd2846a2f9962672c96336d699614a99dbf39c33a20517b8c00df4611f2f12b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / unikan-0.2.5-py3-none-any.whl
| Download URL | unikan-0.2.5-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49128feb960b7e7affeea650c24f0af91b341f3270f6b95467f7fb84da789c50
|
|
BLAKE2b-256 checksum How to use checksums |
d8739e1c7d6f59f89450306b55fd75eea41bbff74a36aa919f78bae39e4b4f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|