Boldly go where Gradient Descent has never gone before with DiscoGrad
Trying to do gradient descent using automatic differentiation over branchy programs? Or to combine them with neural networks for end-to-end training? Then this might be interesting to you. We develped DiscoGrad, a tool for automatic differentiation through C++ programs involving input-dependent control flow (e.g., "if (f(x) < c) { ... }", differentiating wrt. x) and randomness. Our initial motivation was to enable the use of gradient descent with simulations, which often rely heavily on such discrete branching. The latter makes plain autodiff mostly useless, since it can only account for the…
Boldly go where Gradient Descent has never gone before with DiscoGrad launched on May 26, 2024 with 232 votes, #210 of 4,539 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 2 years on.
In plain words
DiscoGrad is an automatic differentiation tool for C++ programs that contain input-dependent branching and randomness. It enables gradient descent optimization through simulations and complex programs where traditional autodiff fails, by accounting for multiple execution paths rather than just the single path taken. The tool is designed for researchers combining discrete control flow with neural networks for end-to-end training and for optimizing simulations that rely heavily on conditional logic.
written from the facts on this page · September 2026
From the sources
DiscoGrad - automatically differentiate across conditional branches in C++ programs - DiscoGrad/DiscoGrad
In the maker’s words, at launch
Trying to do gradient descent using automatic differentiation over branchy programs? Or to combine them with neural networks for end-to-end training? Then this might be interesting to you. We develped DiscoGrad, a tool for automatic differentiation through C++ programs involving input-dependent control flow (e.g.…
Does a similar job
all alternatives →
I wrote an autodiff in C++ and implemented LeNet with it2024 · gitlab.com · ▲36
Autograd.c – A tiny ML framework built from scratchDec 2025 · github.com · ▲85built a tiny pytorch clone in c after going through prof. vijay janapa reddi's mlsys book: mlsysbook.ai/tinytorch/ perfect for learning how ml frameworks work under the hood :)
Microcrad – Micrograd Reimplemented in CJun 2026 · github.com · ▲79A re-implementation of Karpathy's micrograd in C. Contribute to oraziorillo/microcrad development by creating an account on GitHub.

A radically more scalable alternative to Bayesian Optimization2018 · github.com · ▲96Experimental Global Optimization Algorithm. Contribute to chrisstroemel/Simple development by creating an account on GitHub.
A perceptron with stochastic gradient descent in Go2017 · github.com · ▲94A single / multi layer / recurrent neural network written in Golang. - made2591/go-perceptron-go
More ai this month
the category →



Paintings by AI models: programs run through a simulation of oil paint.
AI · 20d ago · stillwet.art

PixVerse R2▲381A real-time world model you can explore and change
AI · 28d ago · world.pixverse.video
Source: Show HN post ↗ · launch text quoted in part