Package: thangldKANr 0.1.0

Thang Le-Dinh

thangldKANr: Kolmogorov-Arnold Networks with Interchangeable Edge Bases Using 'torch'

Implements Kolmogorov-Arnold Networks (KAN) in R on top of the 'torch' package (no 'Python' needed) with one network engine and interchangeable edge bases: Chebyshev, Legendre and Jacobi polynomials, Gaussian radial basis functions (FastKAN), Mexican hat wavelets (Bozorgasl and Chen (2024) <doi:10.48550/arXiv.2405.12832>), safe Pade rational functions (Molina, Schramowski and Kersting (2020) <doi:10.48550/arXiv.1907.06732>), a hybrid of SiLU, Chebyshev and radial basis parts, and squared rectified linear unit bumps (Qiu et al. (2024) <doi:10.48550/arXiv.2406.02075>). Each layer may use a different basis, and further bases can be registered by other packages. Besides tabular regression, the same layers power graph KANs for node regression (neighbourhood aggregation with the normalized adjacency matrix, as in Kiamari, Kiamari and Krishnamachari (2024) <doi:10.48550/arXiv.2406.06470>) and lag-window KANs for one-step time series forecasting. Provides multi-layer networks with Adam training, training-only standardization, validation-based early stopping, reproducible seeds, edge-function evaluation and plots, and model persistence. A base R reference implementation with analytic gradients serves as a numerical oracle and as a training backend that does not need 'libtorch'. The network follows Liu et al. (2024) <doi:10.48550/arXiv.2404.19756>.

Authors:Thang Le-Dinh [aut, cre, cph]

thangldKANr_0.1.0.tar.gz
thangldKANr_0.1.0.zip(r-4.7-any)thangldKANr_0.1.0.zip(r-4.6-any)
thangldKANr_0.1.0.tar.gz(r-4.7-any)thangldKANr_0.1.0.tar.gz(r-4.6-any)
thangldKANr_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
thangldKANr/json (API)

# Install 'thangldKANr' in R:
install.packages('thangldKANr', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/thangpro9999/thangldkanr/issues

On CRAN:

Conda:

3.18 score 50 exports 24 dependencies

Last updated from:3d951cc797. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK147
source / vignettesOK236
linux-releaseOK148
windows-develOK113
windows-releaseOK121
wasm-releaseOK98

Exports:chebyshev_basischebyshev_basis_derivhybrid_basishybrid_basis_derivhybrid_kan_componentsjacobi_basisjacobi_basis_derivkan_baseskan_layer_baseslegendre_basislegendre_basis_derivmexican_hatmexican_hat_derivrationalrational_derivrbf_basisrbf_basis_derivrbf_gridregister_kan_basisrelu_basisrelu_basis_derivthangld_graph_kanthangld_graph_kan_adjacencythangld_graph_kan_fd_gradient_rthangld_graph_kan_fitthangld_graph_kan_forward_rthangld_graph_kan_gradient_rthangld_graph_kan_loadthangld_graph_kan_metricsthangld_graph_kan_savethangld_graph_kan_simulatethangld_graph_kan_validatethangld_kanthangld_kan_edgethangld_kan_fd_gradient_rthangld_kan_fitthangld_kan_forward_rthangld_kan_gradient_rthangld_kan_loadthangld_kan_metricsthangld_kan_savethangld_kan_validatethangld_temporal_kanthangld_temporal_kan_embedthangld_temporal_kan_fitthangld_temporal_kan_loadthangld_temporal_kan_rollingthangld_temporal_kan_savethangld_temporal_kan_validateunregister_kan_basis

Dependencies:bitbit64callrclicorodescfarvergluejsonlitelabelinglifecyclemagrittrotelprocessxpsR6RColorBrewerRcpprlangsafetensorsscalestorchviridisLitewithr

Kolmogorov-Arnold networks with interchangeable edge bases
One engine, many edge types | Fitting and comparing bases | A different basis in each layer | Adding a basis | Persistence and numerical checks

Last update: 2026-11-20
Started: 2026-11-20

Lag-window KAN forecasting with thangldKANr
Model | Leakage rules | Example: Canadian lynx (log scale) | Rolling-origin evaluation against baselines | Validation

Last update: 2026-11-20
Started: 2026-11-20

Node regression with graph KANs
Model | A simulated graph | Deeper networks and the self branch | Cautions | Validation

Last update: 2026-11-20
Started: 2026-11-20

Readme and manuals

Help Manual

Help pageTopics
Chebyshev polynomials and their derivativeschebyshev_basis chebyshev_basis_deriv
Basis functions of a hybrid KAN edgehybrid_basis hybrid_basis_deriv
Size of each basis part on datahybrid_kan_components
Jacobi polynomials and their derivativesjacobi_basis jacobi_basis_deriv
List the available edge baseskan_bases
Bases used by the layers of a modelkan_layer_bases
Legendre polynomials and their derivativeslegendre_basis legendre_basis_deriv
Mexican hat (Ricker) waveletmexican_hat mexican_hat_deriv
Plot a Kolmogorov-Arnold networkplot.thangld_kan
Predict node targetspredict.thangld_graph_kan
Predict with a fitted Kolmogorov-Arnold networkpredict.thangld_kan
One-step-ahead forecastpredict.thangld_temporal_kan
Safe Pade rational functionrational rational_deriv
Gaussian radial basis functionsrbf_basis rbf_basis_deriv rbf_grid
Register an additional edge basisregister_kan_basis unregister_kan_basis
ReLU-KAN basis functions and their derivativesrelu_basis relu_basis_deriv
Create a graph KAN architecturethangld_graph_kan
Normalized adjacency matrix of an undirected graphthangld_graph_kan_adjacency
Fit a graph KAN for node regressionthangld_graph_kan_fit
Forward pass and gradients in base Rthangld_graph_kan_fd_gradient_r thangld_graph_kan_forward_r thangld_graph_kan_gradient_r
Regression metricsthangld_graph_kan_metrics
Save and load a graph KANthangld_graph_kan_load thangld_graph_kan_save
Simulate a stochastic block model graph with node featuresthangld_graph_kan_simulate
Run the numerical validation suitethangld_graph_kan_validate
Create a Kolmogorov-Arnold network with a chosen edge basisthangld_kan
Evaluate a learned edge functionthangld_kan_edge
Fit a Kolmogorov-Arnold network for regressionthangld_kan_fit
Forward pass and gradients in base R (numerical oracle)thangld_kan_fd_gradient_r thangld_kan_forward_r thangld_kan_gradient_r
Regression metricsthangld_kan_metrics
Save and load a Kolmogorov-Arnold networkthangld_kan_load thangld_kan_save
Run the numerical validation suitethangld_kan_validate
Create a lag-window Temporal KANthangld_temporal_kan
Lag-window design matrixthangld_temporal_kan_embed
Fit a Temporal KAN on a seriesthangld_temporal_kan_fit
Rolling-origin one-step evaluationthangld_temporal_kan_rolling
Save and load a Temporal KANthangld_temporal_kan_load thangld_temporal_kan_save
Run the numerical validation suitethangld_temporal_kan_validate