Add warning if gradient-based optimizer is used with particle-filtering

Closes #442