Skip to main content

Temporal KAN model

Project description

TKAN: Temporal Kolmogorov-Arnold Networks

TKAN (Temporal Kolmogorov-Arnold Networks) is a neural network architecture designed to enhance multi-horizon time series forecasting. This TensorFlow implementation integrates TKAN as a layer within sequential models, facilitating the use of advanced neural network techniques in practical applications. It is the original implementation of the paper

Installation

Install TKAN directly from PyPI:

pip install tkan

Dependencies are managed using pyproject.toml.

Usage

TKAN can be used within TensorFlow models to handle complex sequential patterns in data. Here is an example that demonstrates how to use TKAN with B-spline activations in a sequential model:

from temporal_kan import TKAN, BSplineActivation
import tensorflow as tf

# Example model using TKAN with B-spline activations
model = tf.keras.Sequential([
    tf.keras.layers.InputLayer(input_shape=X_train.shape[1:]),
    TKAN(activation_funcs=[BSplineActivation(i) for i in range(5)], num_outputs=100, return_sequences=True),
    TKAN(activation_funcs=[BSplineActivation(i) for i in range(1, 4)], num_outputs=100, return_sequences=False),
    tf.keras.layers.Dense(y_train.shape[1], activation='linear')
], name=f'Sequential_Bspline')

Activation Function Flexibility

TKAN layers are highly flexible with regards to activation functions. They can be configured using various types of activations:

  • Callable classes: Custom classes like BSplineActivation allow for sophisticated configurations.
  • Integers or floats: Specify an initial exponent for a simple power spline activation.
  • None: Defaults to BSplineActivation with an order of 3.
  • Strings: Utilizes standard TensorFlow activation functions.

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

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

tkan-0.1.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

tkan-0.1.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file tkan-0.1.2.tar.gz.

File metadata

  • Download URL: tkan-0.1.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.5.0-14-generic

File hashes

Hashes for tkan-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4e7c2a1a3462f60ce1582bdcff925b1d550513314137edb3aa680cbd78825b24
MD5 b8cf62c68bce4ac0875d4f160c5f67d8
BLAKE2b-256 f936c7c7d81b1f2537a7f7fed9c7fc95cdbaf7ac7c8aa7e39f3812a43d603843

See more details on using hashes here.

File details

Details for the file tkan-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tkan-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Linux/6.5.0-14-generic

File hashes

Hashes for tkan-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04549ad6e901e4d7b7ebc70942c62c20780d3a16c25628e1393a93a9ba864e78
MD5 92904f75d297671f97c8f350e854ccdf
BLAKE2b-256 77ee485c49c47173539e4e4da3f288e0118e41742bbcd7d906f238a43212c47b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page