One-line decorator turns any combinatorial solver into a differentiable NN layer
PMinervini · x · 2026-10-13
Pasin Manurangsi (EdinburghNLP) shared a minimal Python decorator that turns any combinatorial solver — Dijkstra's shortest path, IR ranking functions — into a differentiable neural network layer in one line. It builds on the AAAI 2023 paper "Adaptive Perturbation-Based Gradient Estimation for Discrete Latent Variable Models", extending Implicit MLE (NeurIPS 2021) for backpropagating through black-box solvers. Code is open-sourced as torch-adaptive-imle (MIT); the demo shows wrapping a batched solver with @aimle(targetdistribution=...) to get a differentiable version for end-to-end training with discrete optimization.
More from coding & agent
- Sentry founder: complexity is in database and storage, not the language — zeeg · 2026-10-13
- User says Grok Bot researched and booked his entire Lisbon trip with one prompt — elonmusk · 2026-10-13
- GitHub Actions tip: always cache dependencies — pipelines cut from 20 min to 3 min — vboykis · 2026-10-13
- Grok Bot turns X bookmarks into a Notion second brain in this automated workflow — elonmusk · 2026-10-13
- Open-source Android app runs Codex CLI on your phone via proot, no root needed — 3amae404 · 2026-10-13
- User says Grok replaced his ChatGPT, Claude and Cursor workflows entirely — elonmusk · 2026-10-13