Penalty methods for a class of non-Lipschitz optimization problems