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.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkan-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 487802ee31fa16b64636b7d74a6dfaa12d37ca8a9d2b855709af653ac53e821a
MD5 4ba49b30f1a5762980b54de92c1571db
BLAKE2b-256 3341f7026aa1f9dd61e1c5972ee3e629804f959a7ea0384fcf21cc48ace761c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tkan-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a4d2bcf6e2f79cbed1435daa47571b279a14f62e4f725f16429f608633b040e
MD5 db6b2ba7728070d9757a7a1adee4f1d2
BLAKE2b-256 34f66825a6b272730222742046add3934d77f7af3c9e113bf28d2db1981549fd

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