nmysore commited on
Commit
e8f36d6
Β·
verified Β·
1 Parent(s): 711fbc6

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +192 -18
index.html CHANGED
@@ -1,19 +1,193 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>InKAN β€” Fast B-Spline KAN Layers for PyTorch</title>
7
+ <meta name="description" content="InKAN: Fast uniform cubic B-spline Kolmogorov-Arnold Network (KAN) layers for PyTorch. 2.8-5.4x faster than Cox-de Boor recursion. Drop-in nn.Linear replacement with learnable spline activations.">
8
+ <meta name="keywords" content="inkan, KAN, Kolmogorov-Arnold Network, B-spline, PyTorch, neural network, deep learning, machine learning, learnable activation, spline, interpretable ML">
9
+ <meta name="author" content="Naveen Mysore">
10
+ <link rel="canonical" href="https://pypi.org/project/inkan/">
11
+ <style>
12
+ * { box-sizing: border-box; margin: 0; padding: 0; }
13
+ body {
14
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
15
+ background: #0d1117; color: #c9d1d9;
16
+ line-height: 1.6; padding: 0;
17
+ }
18
+ .hero {
19
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
20
+ padding: 60px 20px; text-align: center;
21
+ }
22
+ .hero h1 { font-size: 3em; color: #58a6ff; margin-bottom: 10px; }
23
+ .hero h1 span { color: #f0883e; }
24
+ .hero p { font-size: 1.2em; color: #8b949e; max-width: 700px; margin: 0 auto 30px; }
25
+ .install {
26
+ background: #161b22; border: 1px solid #30363d; border-radius: 8px;
27
+ padding: 15px 25px; display: inline-block; font-family: monospace;
28
+ font-size: 1.1em; color: #7ee787; cursor: pointer;
29
+ }
30
+ .install:hover { border-color: #58a6ff; }
31
+ .badges { margin: 20px 0; }
32
+ .badges img { margin: 0 4px; }
33
+ .container { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
34
+ h2 { color: #58a6ff; font-size: 1.5em; margin: 40px 0 15px; border-bottom: 1px solid #21262d; padding-bottom: 8px; }
35
+ .feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
36
+ .feature {
37
+ background: #161b22; border: 1px solid #30363d; border-radius: 8px;
38
+ padding: 20px;
39
+ }
40
+ .feature h3 { color: #f0883e; margin-bottom: 8px; }
41
+ .feature p { color: #8b949e; font-size: 0.95em; }
42
+ pre {
43
+ background: #161b22; border: 1px solid #30363d; border-radius: 8px;
44
+ padding: 20px; overflow-x: auto; font-size: 0.9em;
45
+ }
46
+ code { color: #7ee787; }
47
+ .kw { color: #ff7b72; }
48
+ .fn { color: #d2a8ff; }
49
+ .str { color: #a5d6ff; }
50
+ .cmt { color: #8b949e; }
51
+ .num { color: #79c0ff; }
52
+ a { color: #58a6ff; text-decoration: none; }
53
+ a:hover { text-decoration: underline; }
54
+ .links { display: flex; gap: 15px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
55
+ .links a {
56
+ background: #21262d; border: 1px solid #30363d; border-radius: 8px;
57
+ padding: 12px 24px; font-size: 1em; transition: 0.2s;
58
+ }
59
+ .links a:hover { border-color: #58a6ff; background: #161b22; text-decoration: none; }
60
+ .comparison { width: 100%; border-collapse: collapse; margin: 20px 0; }
61
+ .comparison th, .comparison td { padding: 10px 15px; border: 1px solid #30363d; text-align: left; }
62
+ .comparison th { background: #161b22; color: #58a6ff; }
63
+ .comparison td { color: #c9d1d9; }
64
+ .highlight { color: #7ee787; font-weight: bold; }
65
+ .math {
66
+ background: #161b22; border: 1px solid #30363d; border-radius: 8px;
67
+ padding: 20px; margin: 15px 0; text-align: center;
68
+ font-family: 'Times New Roman', serif; font-size: 1.2em; color: #c9d1d9;
69
+ }
70
+ footer { text-align: center; padding: 40px; color: #484f58; font-size: 0.9em; }
71
+ @media (max-width: 600px) {
72
+ .feature-grid { grid-template-columns: 1fr; }
73
+ .hero h1 { font-size: 2em; }
74
+ }
75
+ </style>
76
+ </head>
77
+ <body>
78
+
79
+ <div class="hero">
80
+ <h1>In<span>KAN</span></h1>
81
+ <p>Fast B-spline Kolmogorov-Arnold Network layers for PyTorch.<br>
82
+ Drop-in <code>nn.Linear</code> replacement with learnable spline activations.</p>
83
+
84
+ <div class="badges">
85
+ <a href="https://pypi.org/project/inkan/"><img src="https://img.shields.io/pypi/v/inkan" alt="PyPI"></a>
86
+ <a href="https://pypi.org/project/inkan/"><img src="https://img.shields.io/pypi/dm/inkan" alt="Downloads"></a>
87
+ <img src="https://img.shields.io/pypi/pyversions/inkan" alt="Python">
88
+ <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT">
89
+ </div>
90
+
91
+ <div class="install" onclick="navigator.clipboard.writeText('pip install inkan')">
92
+ pip install inkan
93
+ </div>
94
+ <p style="font-size: 0.8em; color: #484f58; margin-top: 8px;">click to copy</p>
95
+ </div>
96
+
97
+ <div class="container">
98
+
99
+ <h2>What is a KAN?</h2>
100
+ <p>In a standard MLP, each connection has a fixed weight and a shared activation function.
101
+ In a <strong>Kolmogorov-Arnold Network</strong>, each edge has its own learnable univariate function
102
+ &phi;(x) &mdash; a B-spline curve that transforms the scalar flowing along that edge.</p>
103
+
104
+ <div class="math">
105
+ MLP: &ensp; y = &sigma;(W&middot;x + b) &emsp;&emsp;&emsp;
106
+ KAN: &ensp; y<sub>j</sub> = &sum;<sub>i</sub> &phi;<sub>ji</sub>(x<sub>i</sub>)
107
+ </div>
108
+
109
+ <p>Each &phi;<sub>ji</sub> is a learned cubic B-spline with <strong>local support</strong>:
110
+ changing one coefficient affects the function over only ~4 knot intervals.
111
+ This makes KANs inherently more interpretable and editable than MLPs.</p>
112
+
113
+ <h2>Why InKAN?</h2>
114
+
115
+ <div class="feature-grid">
116
+ <div class="feature">
117
+ <h3>2.8&ndash;5.4x Faster</h3>
118
+ <p>Stable piecewise polynomial evaluation instead of recursive Cox-de Boor.
119
+ Local 4-basis lookup instead of dense K-basis computation.</p>
120
+ </div>
121
+ <div class="feature">
122
+ <h3>Drop-in Replacement</h3>
123
+ <p><code>KANLayer(in, out)</code> replaces <code>nn.Linear(in, out)</code>.
124
+ Same interface, same optimizer, same training loop.</p>
125
+ </div>
126
+ <div class="feature">
127
+ <h3>Numerically Stable</h3>
128
+ <p>Guaranteed non-negative basis output. Float32 accuracy ~1.2e-7.
129
+ No catastrophic cancellation from alternating sums.</p>
130
+ </div>
131
+ <div class="feature">
132
+ <h3>1D and 2D Splines</h3>
133
+ <p>Univariate spline layers plus tensor-product B-spline surfaces
134
+ for joint function approximation.</p>
135
+ </div>
136
+ </div>
137
+
138
+ <h2>Quick Start</h2>
139
+ <pre><code><span class="kw">import</span> torch
140
+ <span class="kw">from</span> inkan <span class="kw">import</span> KANLayer, KANNetwork
141
+
142
+ <span class="cmt"># Single layer β€” drop-in for nn.Linear</span>
143
+ layer = <span class="fn">KANLayer</span>(<span class="num">8</span>, <span class="num">4</span>)
144
+ x = torch.<span class="fn">randn</span>(<span class="num">32</span>, <span class="num">8</span>)
145
+ y = <span class="fn">layer</span>(x) <span class="cmt"># [32, 4]</span>
146
+
147
+ <span class="cmt"># Multi-layer network</span>
148
+ net = <span class="fn">KANNetwork</span>([<span class="num">784</span>, <span class="num">64</span>, <span class="num">10</span>])
149
+ x = torch.<span class="fn">randn</span>(<span class="num">32</span>, <span class="num">784</span>)
150
+ y = <span class="fn">net</span>(x) <span class="cmt"># [32, 10]</span>
151
+
152
+ <span class="cmt"># Standard PyTorch training</span>
153
+ optimizer = torch.optim.<span class="fn">Adam</span>(net.<span class="fn">parameters</span>(), lr=<span class="num">1e-3</span>)
154
+ loss = y.<span class="fn">sum</span>()
155
+ loss.<span class="fn">backward</span>()
156
+ optimizer.<span class="fn">step</span>()</code></pre>
157
+
158
+ <h2>Performance</h2>
159
+ <table class="comparison">
160
+ <tr>
161
+ <th>Method</th><th>Grid Size 8</th><th>Grid Size 20</th><th>Grid Size 50</th>
162
+ </tr>
163
+ <tr>
164
+ <td>Cox-de Boor (recursive)</td><td>1.0x</td><td>1.0x</td><td>1.0x</td>
165
+ </tr>
166
+ <tr>
167
+ <td><strong>InKAN (piecewise + local)</strong></td>
168
+ <td class="highlight">2.8x faster</td>
169
+ <td class="highlight">3.9x faster</td>
170
+ <td class="highlight">5.4x faster</td>
171
+ </tr>
172
+ </table>
173
+
174
+ <h2>Used In</h2>
175
+ <p><a href="https://github.com/NAVEENMN/attention_manifolds">Attention Manifolds</a> &mdash;
176
+ Learned B-spline coordinate curves for AI safety and mechanistic interpretability in transformer attention.
177
+ Per-coordinate spline curves on Q/K projections, trained on Llama-3.2-1B and 3B.</p>
178
+
179
+ <div class="links">
180
+ <a href="https://pypi.org/project/inkan/">πŸ“¦ PyPI</a>
181
+ <a href="https://github.com/NAVEENMN/inkan">πŸ’» GitHub</a>
182
+ <a href="https://arxiv.org/abs/2609.01956">πŸ“„ Paper</a>
183
+ <a href="https://naveenmn.github.io/inkan/">πŸ“– Docs</a>
184
+ </div>
185
+
186
+ </div>
187
+
188
+ <footer>
189
+ InKAN &copy; 2026 Naveen Mysore &middot; MIT License
190
+ </footer>
191
+
192
+ </body>
193
  </html>