{"id":50596627,"url":"https://github.com/alibayeh/trukan","last_synced_at":"2026-06-22T10:00:36.920Z","repository":{"id":360814863,"uuid":"1121227866","full_name":"alibayeh/trukan","owner":"alibayeh","description":"TruKAN: Kolmogorov-Arnold Networks Using Truncated Power Functions","archived":false,"fork":false,"pushed_at":"2026-06-20T03:41:50.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T05:23:09.977Z","etag":null,"topics":["compiler","kan-compiler","kolmogorov-arnold-network","kolmogorov-arnold-networks","kolmogorov-arnold-representation","physics-informed-neural-networks","plotting-library","sympy-expressions","trukan","truncated-power","truncated-power-functions"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alibayeh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-22T16:33:13.000Z","updated_at":"2026-06-20T03:41:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alibayeh/trukan","commit_stats":null,"previous_names":["alibayeh/trukan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alibayeh/trukan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibayeh%2Ftrukan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibayeh%2Ftrukan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibayeh%2Ftrukan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibayeh%2Ftrukan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alibayeh","download_url":"https://codeload.github.com/alibayeh/trukan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibayeh%2Ftrukan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34643624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"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":["compiler","kan-compiler","kolmogorov-arnold-network","kolmogorov-arnold-networks","kolmogorov-arnold-representation","physics-informed-neural-networks","plotting-library","sympy-expressions","trukan","truncated-power","truncated-power-functions"],"created_at":"2026-06-05T15:00:20.424Z","updated_at":"2026-06-22T10:00:36.912Z","avatar_url":"https://github.com/alibayeh.png","language":"Python","funding_links":[],"categories":["Library"],"sub_categories":["Theorem"],"readme":"# trukan\n\n[![arXiv](https://img.shields.io/badge/arXiv-2602.03879-b31b1b.svg)](https://arxiv.org/abs/2602.03879)\n\n**TruKAN** is a Python package implementing a novel, efficient variation of Kolmogorov-Arnold Networks (KANs). It replaces the B-spline basis with truncated power functions derived from k-order spline theory, better interpretability, and strong performance on real-world tasks.\n\n## About TruKAN\n\nTruKAN preserves the canonical KAN topology and learnable univariate activations but replaces the computationally heavy B-spline basis with a family of **truncated power functions** `(x - t_j)_+^k` combined with a low-order polynomial term. This design maintains full expressiveness while improved the performance.\n\nKey advantages demonstrated in the paper:\n- **Efficiency**: Lower GPU memory compared to standard KAN (pykan) and some other variants.\n- **Interpretability**: Explicit decomposition into polynomial + truncated-power terms makes learned functions easy to analyze and visualize.\n- **Flexibility**: Supports both shared knots (more efficient) and individual knots (more expressive).\n- **Performance**: Outperforms MLP, standard KAN, and SineKAN on CIFAR-10/100, STL-10, and Oxford-IIIT Pets when integrated into an EfficientNet-V2 backbone.\n\n**Paper**: [TruKAN: Towards More Efficient Kolmogorov-Arnold Networks Using Truncated Power Functions](https://arxiv.org/abs/2602.03879)  \n**Authors**: Ali Bayeh, Samira Sadaoui, Malek Mouhoub  \n**arXiv**: 2602.03879 (February 2026)\n\n\n\n**TruKAN Layer Structure**  \n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg src=\"./assets/trukan_fixed.svg\" height=\"200\"\u003e\u003cbr\u003e\n      \u003csub\u003e(a) Fixed-knot version (equal intervals)\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg src=\"./assets/trukan_learnable.svg\" height=\"200\"\u003e\u003cbr\u003e\n      \u003csub\u003e(b) Learnable-knot version (trainable knot positions with ordering constraints)\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n**Learned Activations**  \n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg src=\"./assets/trukan_trained.svg\" height=\"200\"\u003e\u003cbr\u003e\n      \u003csub\u003e(a) Trained TruKAN\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg src=\"./assets/trukan_pruned.svg\" height=\"200\"\u003e\u003cbr\u003e\n      \u003csub\u003e(b) Pruned TruKAN\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\n- [x] Compiler\n- [x] Plotter\n    - [x] TruKAN\n    - [x] CustomKAN (ChebyKAN, EfficientKAN, SineKAN)\n- [ ] Pruner\n    - [x] TruKAN\n    - [ ] CustomKAN\n\n## Compiler\n\n- Compile a SymPy symbolic expression into a TruKan model.\n\n### Design differences vs. pykan's compiler\n- Pykan pins each edge to a symbolic function using ``fix_symbolic``, which writes to a parallel Symbolic_KANLayer.  TruKan has no symbolic layer. Instead, we *fit* the truncated-power-basis coefficients to the target 1-D function via ordinary least squares over ``knots_range``.  The fit quality depends on how well a degree-``degree`` truncated-power spline can represent the function; cubic (degree=3) is accurate for smooth elementary functions with a reasonably dense knot grid.\n\n- Pykan stores per-node and per-subnode affine parameters (``node_scale``, ``node_bias``, ``subnode_scale``, ``subnode_bias``) as learnable tensors. TruKan only has ``bias_out`` per layer, and the constant basis function (the '1' in [1, u, u², u³, …]) already absorbs constant offsets. We fold *every* affine transformation extracted during tree-parsing directly into the least-squares target function so the compiled model is self-contained and needs no extra parameters.\n\n- Standard TruKan is a sum-only KAN: the output of each layer is```\n   output_j = Σ_i  basis(x_i) @ coeffs[i, j, :]   ```\nExpressions with products of *distinct symbolic variables* (e.g. x*y, sin(x)*cos(y)) cannot be represented and are rejected.\n\n## Generic Plotter \u0026 Pruner\n- Why it is generic?\n  - **trukan** tools work with *any* KAN-style model that follows a minimal interface:\n    - Consistent naming convention.\n    - Implementation of a single method that returns the numerical activation functions.\n\n- How it works?\n  - Any compatible KAN variation can be plotted automatically. No forking or rewriting of visualization code is required.\n\n\n## Citation\nIf you use this code in your research, please cite the following paper:\n\n```bibtex\n@ARTICLE{Bayeh2026TruKAN,\n  title         = \"{TruKAN}: Towards more efficient {Kolmogorov-Arnold}\n                   networks using truncated power functions\",\n  author        = \"Bayeh, Ali and Sadaoui, Samira and Mouhoub, Malek\",  \n  month         =  feb,\n  year          =  2026,\n  copyright     = \"http://creativecommons.org/licenses/by/4.0/\",\n  archivePrefix = \"arXiv\",\n  primaryClass  = \"cs.CV\",\n  eprint        = \"2602.03879\"\n}\n```\n\n## License\n\n`trukan` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n\n## Acknowledgements\nThe design and implementation ideas for the compiler, pruner, and plotter components were influenced by the approaches used in PyKAN.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibayeh%2Ftrukan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falibayeh%2Ftrukan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibayeh%2Ftrukan/lists"}