How do the Karush-Kuhn-Tucker Conditions work(Machine Learning)