A port of the proximal gradient method from https://github.com/pmelchior/proxmin.
https://github.com/pmelchior/proxmin