  Many real-world optimization problems contain parameters that are unknown
before deployment time, either due to stochasticity or to lack of information
(e.g., demand or travel times in delivery problems). A common strategy in such
cases is to estimate said parameters via machine learning (ML) models trained
to minimize the prediction error, which however is not necessarily aligned with
the downstream task-level error. The decision-focused learning (DFL) paradigm
overcomes this limitation by training to directly minimize a task loss, e.g.
regret. Since the latter has non-informative gradients for combinatorial
problems, state-of-the-art DFL methods introduce surrogates and approximations
that enable training. But these methods exploit specific assumptions about the
problem structures (e.g., convex or linear problems, unknown parameters only in
the objective function). We propose an alternative method that makes no such
assumptions, it combines stochastic smoothing with score function gradient
estimation which works on any task loss. This opens up the use of DFL methods
to nonlinear objectives, uncertain parameters in the problem constraints, and
even two-stage stochastic optimization. Experiments show that it typically
requires more epochs, but that it is on par with specialized methods and
performs especially well for the difficult case of problems with uncertainty in
the constraints, in terms of solution quality, scalability, or both.
