Introduction§

TimeKAN is a Python library that implements Kolmogorov-Arnold Networks (KAN) with recurrent neural network architectures in Pytorch. Currently, it still in experimental stage but with careful training it can perform quite well on some time series tasks.

_images/timeKAN.png

In tKANLSTM, KAN layers replace the output gate, computing \(o_t = \sigma(\text{KAN}(W_x x_t + W_h h_{t-1}))\). In tKANGRU, they form the candidate hidden state, \(\tilde{h}_t = \tanh(\text{KAN}(W_x x_t + W_h (r_t \odot h_{t-1})))\). The layer basis functions can be Fourier series, Chebyshev polynomials, or splines.

Here’s how it can perform on Rossler system signal:

_images/rossler_system.png

The table below compares TimeKAN (using tKANLSTM and spline as basic functions) and a standard bidirectional LSTM on three chaotic datasets available in timekan.utils.datasets. Metrics include Mean Absolute Error (MAE) and training time (seconds) until convergence.

Dataset

Model

MAE

Training Time (s)

Mackey-Glass

LSTM

0.0893

0.3346

TimeKAN

0.0822

9.8755

Lorenz

LSTM

0.9410

1.1331

TimeKAN

0.7485

7.9437

Rössler

LSTM

0.3332

1.3951

TimeKAN

0.2657

12.4172

Contents§