|
1 | | -# torchkan |
| 1 | +# TorchKAN: Simplified KAN Model Evaluation |
2 | 2 |
|
3 | | -**Under Development** |
| 3 | +This project demonstrates the training, validation, and quantization of the KAN model using PyTorch with CUDA acceleration. The `torchkan` model evaluates performance on the MNIST dataset, providing insights into the capabilities of Generalized Additive Models (GAMs). |
4 | 4 |
|
| 5 | +## Project Status: Under Development |
5 | 6 |
|
6 | | -# TorchKAN: KAN Model Evaluation with PyTorch and CUDA |
7 | | - |
8 | | -This project demonstrates the training, validation, and quantization of the simplified KAN model using PyTorch, with CUDA acceleration for improved performance. The project builds the `torchkan` library to create and evaluate KAN models on the MNIST dataset, as a preliminary test. |
| 7 | +The KAN model has shown promising results amidst various GAMs since the 1980s. This implementation, inspired by various sources, achieves over 97% accuracy on the MNIST dataset. As this model is still under study, further exploration into its full capabilities is ongoing. |
9 | 8 |
|
10 | 9 | ## Prerequisites |
11 | 10 |
|
12 | | -Before you begin, ensure you have the following installed on your system: |
13 | | -- Python (version 3.6 or higher) |
14 | | -- CUDA Toolkit (corresponding to the CUDA version required by your PyTorch installation) |
| 11 | +Ensure you have the following installed on your system: |
| 12 | + |
| 13 | +- Python (version 3.9 or higher) |
| 14 | +- CUDA Toolkit (corresponding to your PyTorch installation's CUDA version) |
15 | 15 | - cuDNN (compatible with your installed CUDA Toolkit) |
16 | 16 |
|
17 | | -## Installation (Tested on MacOS and Linux) |
| 17 | +## Installation |
| 18 | + |
| 19 | +Tested on MacOS and Linux. |
18 | 20 |
|
19 | 21 | ### 1. Clone the Repository |
20 | 22 |
|
21 | | -Start by cloning the repository containing the `torchkan` library and navigating into the project directory: |
| 23 | +Clone the `torchkan` repository and set up the project environment: |
22 | 24 |
|
23 | 25 | ```bash |
24 | 26 | git clone https://github.com/1ssb/torchkan.git |
25 | 27 | cd torchkan |
26 | 28 | pip install -r requirements.txt |
27 | 29 | ``` |
28 | 30 |
|
29 | | -If not already installed: |
| 31 | +### 2. Configure CUDA environment variables if they are not already set: |
30 | 32 |
|
31 | 33 | ```bash |
32 | 34 | export PATH=/usr/local/cuda/bin:$PATH |
33 | 35 | export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
34 | 36 | ``` |
35 | 37 |
|
36 | | -To run the MNIST training, make sure you configure wandb and run the script: |
| 38 | +### 3. Configure Weights & Biases (wandb) |
| 39 | + |
| 40 | +To track experiments and model performance with wandb: |
| 41 | + |
| 42 | +1. **Set Up wandb Account:** |
| 43 | + |
| 44 | +- Sign up or log in at [Weights & Biases](https://wandb.ai). |
| 45 | +- Find your API key in your account settings. |
| 46 | + |
| 47 | +2. **Initialize wandb in Your Project:** |
| 48 | + |
| 49 | +Before running the training script, initialize wandb: |
37 | 50 |
|
38 | 51 | ```python |
39 | | -python mnist.py |
| 52 | +wandb login |
40 | 53 | ``` |
41 | 54 |
|
| 55 | +When prompted, enter your API key. This will link your script executions to your wandb account. |
| 56 | + |
| 57 | +3. **Make sure to change the Entity name in the `mnist.py` file to your username instead of `1ssb`** |
| 58 | + |
| 59 | +This script will train the model, validate it, and log performance metrics using wandb. |
| 60 | + |
42 | 61 | ## Contact |
43 | 62 |
|
44 | | -For questions contact me at Subhransu.Bhattacharjee@anu.edu.au |
| 63 | +For any inquiries or support, contact: Subhransu.Bhattacharjee@anu.edu.au |
45 | 64 |
|
46 | 65 | ## Contributions |
47 | 66 |
|
48 | | -Contributions are welcome, please raise issues as required after commit Fin. This repository is still under development and testing. The code is licensed under the MIT License. |
| 67 | +Contributions are welcome. Please raise issues as necessary after commit "Fin.", scheduled end-June, 2024. The code is licensed under the MIT License. |
| 68 | + |
| 69 | +## References |
| 70 | + |
| 71 | +- [0] Ziming Liu et al., "KAN: Kolmogorov-Arnold Networks", 2024, arXiv. https://arxiv.org/abs/2404.19756 |
| 72 | +- [1] https://github.com/KindXiaoming/pykan |
| 73 | +- [2] https://github.com/Blealtan/efficient-kan |
0 commit comments