Repository navigation
Fixed
MatrixKANis marked experimental. In 0.2.0 the class does not evaluate B-splines with a batched GEMM.b_spline_basis_matrixis the Cox–de Boor recursion with a Python loop over each basis index, andbuild_recurrence_matrix_batchis unused. A constant matrix cannot represent that recursion because the weights depend onx. The 0.2.0 docstring and README described the GEMM anyway. 0.2.0 stays on PyPI. This release corrects the description. It does not change the forward pass.- A Tesla T4 sweep of that loop (torch 2.11.0+cu130, kanx 0.2.0, shape
[2, width, 1], width 32–512, batch 1,024–16,384) is slower than vectorizedKAN. The ratio falls from about 6.4× to about 3.3× and stays there. At width 32 and batch 4,096 the calls are 2.10 ms and 13.37 ms. The JSON isbenchmarks/results/matrixkan_t4_0.2.0.json. - The published CPU table is a warmed three-seed run on an Intel Core i9-9900, TensorFlow 2.21.0. The 0.2.0 single-call columns are not averaged in.
- The static
fit_grid_to_datasnippet callsmodel.build((None, n_features))first. An unbuiltKANhas no layer weights, andfit_grid_to_dataraises. - Docs no longer say the spline is zero outside
[-1, 1], or that knot differences underflow in float16. The basis stays float32 because(x - t_i)cancels near a knot. Float16's largest finite value is 65504. That is a format limit, not an overflow measured in this contraction. bfloat16 is the practical training dtype because float16 gradients underflow without loss scaling. - Docs say
prune()zeros coefficients and leaves the tensor shape unchanged.
Changed
- Package version is 0.2.1 in
pyproject.toml,kanx.__version__,CITATION.cff, and the Helm chartappVersion.
What's Changed
- docs: cover 0.2.0 features in the quickstart notebook by @Mattral in #15
- docs: correct grid, prune, and MatrixKAN claims by @Mattral in #17
- fix: mark MatrixKAN experimental in 0.2.1 by @Mattral in #18
Full Changelog: v0.2.0...v0.2.1