Registre de correu electrònic: Optimization of non-smooth functions via differentiable surrogates.