Bo

Boldly go where Gradient Descent has never gone before with DiscoGrad

Hacker News

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 single path taken through the program. Our tool offers several backends that handle this situation, giving useful descent directions for optimization by accounting for alternative branches. Besides simulations, this problem arises in many other places, for example in deep learning when trying to combine imperative programs with neural networks. In a nutshell, DiscoGrad applies an (LLVM-based) source-to-source transformation to your C++ program, adding some calls to our header library, which then handles the gradient computation. What sets it apart from similar tools/estimators is that it's fully automatic (no need to come up with a differentiable problem formulation/reparametrization) and that the branching condition can be any function of the program inputs (no need to know upfront what distribution the condition follows). We're currently a team of two working on DiscoGrad as part of a research project, so don't expect to see production-grade code quality, but we do intend for it to be more than a throwaway research prototype. Use cases we've successfully tested include calibrating simulation models of epidemics or evacuation scenarios via gradient descent, and combining simulations with neural networks in an end-to-end trainable fashion. We hope you find this interesting and useful, and we're happy to answer questions!

Share card

Actual performance

232points
66comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: model, models, single · Missing: mac, agents, macos
83%83% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: para, ios · Missing: supports, reddit linkedin, podcasting
70%70% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
58%58% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Strong signals: calls · Missing: plus, platform, intuitive
50%50% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: ios, way, para · Missing: mobile apps, personal, entrepreneurs
35%35% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: training · Missing: arr, mrr, revenue
15%15% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

A
A perceptron with stochastic gradient descent in Go48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A perceptron with stochastic gradient descent in Go

Hacker News94
No
Not Another Gradient Generator45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Not Another Gradient Generator

Hacker News18
DB
DBoost stochastic gradient boosting via Ridge with random dummies42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DBoost stochastic gradient boosting via Ridge with random dummies

Hacker News8
CS
CSS Gradient59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CSS Gradient

Hacker News1
CS
CSS Gradient Fixer59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CSS Gradient Fixer

Hacker News6
Gr
Gradient Hunt49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Gradient Hunt

Hacker News4
I
I made a simple hue/gradient game45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I made a simple hue/gradient game

Hacker News6
Gradient
Gradient45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

TensorFlow for .NET/C#

Indie Hackers2ai
Gradient Art
Gradient Art64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

An advanced CSS gradient editor

Indie Hackers1art
Sw
Swift Gradient48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Swift Gradient

Hacker News2