This is the code to go along with my blog post on C++ differentiable programming / gradient descent.
That blog post is at https://blog.demofox.org/2017/12/23/c-differentiable-programming-searching-for-an-optimal-dither-pattern/
Questions, comments, etc, hit me up on twitter: https://twitter.com/Atrix256