{"id":14958684,"url":"https://github.com/remigenet/tkan","last_synced_at":"2025-10-09T15:36:20.142Z","repository":{"id":239145996,"uuid":"798338225","full_name":"remigenet/TKAN","owner":"remigenet","description":"TKAN: Temporal Kolmogorov-Arnold Networks","archived":false,"fork":false,"pushed_at":"2024-12-16T22:11:35.000Z","size":58670,"stargazers_count":213,"open_issues_count":1,"forks_count":30,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T15:36:17.538Z","etag":null,"topics":["jax","keras","keras3","kolmogorov-arnold-networks","temporal","temporal-networks","tensorflow","tensorflow2","timeseries-forecasting","tkan","torch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remigenet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T15:21:20.000Z","updated_at":"2025-09-04T02:48:46.000Z","dependencies_parsed_at":"2024-07-15T16:59:35.894Z","dependency_job_id":"cbf6448c-4636-452a-bcc3-bd7409e0019f","html_url":"https://github.com/remigenet/TKAN","commit_stats":{"total_commits":41,"total_committers":4,"mean_commits":10.25,"dds":0.3414634146341463,"last_synced_commit":"d651a561ecc35198ba1f26aae7e6992180b80105"},"previous_names":["remigenet/tkan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/remigenet/TKAN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remigenet%2FTKAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remigenet%2FTKAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remigenet%2FTKAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remigenet%2FTKAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remigenet","download_url":"https://codeload.github.com/remigenet/TKAN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remigenet%2FTKAN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001646,"owners_count":26083147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jax","keras","keras3","kolmogorov-arnold-networks","temporal","temporal-networks","tensorflow","tensorflow2","timeseries-forecasting","tkan","torch"],"created_at":"2024-09-24T13:17:49.773Z","updated_at":"2025-10-09T15:36:20.090Z","avatar_url":"https://github.com/remigenet.png","language":"Python","readme":"# TKAN: Temporal Kolmogorov-Arnold Networks\n\nTKAN (Temporal Kolmogorov-Arnold Networks) is a neural network architecture designed to enhance multi-horizon time series forecasting. \nThis Keras implementation integrates TKAN as a layer within sequential models, facilitating the use of advanced neural network techniques in practical applications. \nThe implementation is tested to be compatatible with Tensorflow, Jax and Torch. From testing jax is the best backend in terms of performance with it, while torch is very slow (probably not well optimized for it).\nIt is the original implementation of the [paper](https://arxiv.org/abs/2405.07344)\nThe KAN part implementation has been inspired from [efficient_kan](https://github.com/Blealtan/efficient-kan), and is available [here](https://github.com/remigenet/keras_efficient_kan) and works similarly to it, thus not exactly like the [original implementation](https://github.com/KindXiaoming/pykan).\n\nIn case of performance consideration, the best setup tested used [jax docker image](https://hub.docker.com/r/bitnami/jax/) followed by installing jax using ```pip install \"jax[cuda12]\"```, this is what is used in the example section where you can compare the TKAN vs LSTM vs GRU time and performance.\nI also discourage using as is the example for torch, it seems that currently when running test using torch backend with keras is much slower than torch directly, even for GRU or LSTM. \n\n![TKAN representation](image/TKAN.drawio.png)\n## Installation\n\nInstall TKAN directly from PyPI:\n\n```bash\npip install tkan\n```\n\nDependencies are managed using pyproject.toml.\n\n## Usage\n\nTKAN can be used within TensorFlow models to handle complex sequential patterns in data.\nIt's implementation reproduce architecture of RNN in tensorflow with Cell class and Layer that inherits from RNN in order to provide a perfect integrations with tensorflow.\nHere is an example that demonstrates how to use TKAN in a sequential model:\n\n```python\nimport keras\nfrom tkan import TKAN\n\n\n# Example model using TKAN with B-spline activations\nmodel = keras.Sequential([\n      keras.layers.InputLayer(input_shape=X_train_seq.shape[1:]),\n      TKAN(100, sub_kan_configs=[{'spline_order': 3, 'grid_size': 10}, {'spline_order': 1, 'grid_size': 5}, {'spline_order': 4, 'grid_size': 6}, ], return_sequences=True, use_bias=True), #Define the params of the KANLinear as dict as here\n      TKAN(100, sub_kan_configs=[1, 2, 3, 3, 4], return_sequences=True, use_bias=True), #Use float or int to specify only the exponent of the spline\n      TKAN(100, sub_kan_configs=['relu', 'relu', 'relu', 'relu', 'relu'], return_sequences=True, use_bias=True), #Or use string to specify the standard tensorflow activation using Dense in sublayers instead of KANLinear\n      TKAN(100, sub_kan_configs=[None for _ in range(3)], return_sequences=False, use_bias=True), # Or put None for default activation\n      keras.layers.Dense(y_train_seq.shape[1]),\n])\n```\n\nYou can find a more complete example with comparison with other models in the example folder.\n\n## Other visualizations\n\nThanks to [kkkkcccc88](https://github.com/kkkkcccc88) for this participation to the project by creating this visualization of the TKAN architecture.\n![TKAN IMAGE](image/TKAN_IMAGE.png)\n\nPlease cite our work if you use this repo:\n\n```\n@article{genet2024tkan,\n  title={Tkan: Temporal kolmogorov-arnold networks},\n  author={Genet, Remi and Inzirillo, Hugo},\n  journal={arXiv preprint arXiv:2405.07344},\n  year={2024}\n}\n```\n\nShield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]\n\nThis work is licensed under a\n[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].\n\n[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]\n\n[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/\n[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png\n[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremigenet%2Ftkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremigenet%2Ftkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremigenet%2Ftkan/lists"}