A Python library based on pytorch for universally building KAN-type networks
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
unikan-0.2.5.tar.gz
(9.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unikan-0.2.5.tar.gz.
File metadata
- Download URL: unikan-0.2.5.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5995203fe36170110cbbc6c7131d193d5cf30a2fa9efc3f56150fe09e2da4311
|
|
| MD5 |
c7aafe74140284ab17564d61ef95edc8
|
|
| BLAKE2b-256 |
abd2846a2f9962672c96336d699614a99dbf39c33a20517b8c00df4611f2f12b
|
File details
Details for the file unikan-0.2.5-py3-none-any.whl.
File metadata
- Download URL: unikan-0.2.5-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49128feb960b7e7affeea650c24f0af91b341f3270f6b95467f7fb84da789c50
|
|
| MD5 |
f265f6ba102c984ea850eb87c4be84ec
|
|
| BLAKE2b-256 |
d8739e1c7d6f59f89450306b55fd75eea41bbff74a36aa919f78bae39e4b4f4e
|