dtormoen/neural-open.nvim
A smart picker for Snacks.nvim that trains a neural network with your file picking preferences.
What's novel
A smart picker for Snacks.nvim that trains a neural network with your file picking preferences.
Code Analysis
10 files read · 3 roundsA Neovim file picker plugin that implements a full neural network (MLP with batch normalization, dropout, AdamW optimizer) from scratch in pure Lua to learn and rank file selections based on 11 contextual features, with online training via pairwise hinge loss.
Strengths
Genuinely deep implementation of a neural network in pure Lua with proper batch norm backward pass, gradient clipping, AdamW with warmup, and zero-allocation performance optimizations throughout the hot path. The architecture cleanly separates core math, training, inference, feature engineering, and Snacks.nvim integration, with per-picker state isolation and feature migration support.
Weaknesses
The pure-Lua matrix operations (triple-nested loops for matmul) will be significantly slower than a C-based approach, though the small network size (11→16→16→8→1) mitigates this. The 60KB nn.lua file, while well-organized internally, is large and could benefit from further decomposition of the state management and weight persistence logic.
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
56
Contributors
3
Files
81
Active weeks
3
Repository
Language
Lua
Stars
51
Forks
1
License
MIT