Gradient Based Optimization Algorithm In Python Definition