Show HN: I implemented a neural network in SQL

42 points10 comments3 hours ago
sporkl

I've been working on something similar, implementing a relational language on top of a tensor library[0].

Mathematically, einsum and database joins are the same thing, just over different semirings (real numbers for einsum, booleans for databases). A lot of papers about datalog explore this sort of thing in more depth. In particular, Dyna[1] might be interesting.

[0]: https://arxiv.org/abs/2509.22614 [1]: https://dyna.org/

HPsquared

Somewhat more reliable than implementing SQL in neural networks.

tommica

I'm just going to go back to making my CRUD endpoints...

Jokes aside, sounds really impressive, though I only understood about 10% :D

0xnyn

initially rolled my eyes at "neural networks in SQL," but after reading the code I came away impressed

basically it comes down to using relational algebra as the IR, letting a database optimizer reason about tensor programs

show comments
soupspaces

Neat! Feels analogous to "X runs Doom" demos (but NN).

show comments
iqbal1980

Why? lol

show comments