In general, c needs to be adjusted such that an improvement in the simulation results yields a lower loss function value z * , while a worsening would yield a higher value (i.e. d dz z * (c, z) = 0). This is required because otherwise the gradient-based optimization algorithm can not calculate a descent direction to update the parameter set and suggest a better solution. Additionally, c must be chosen such that the loss function value for unwanted results does not fall below the threshold that causes the optimization to stop.