Parameter Optimization Using Gradient-Based Algorithms - Coding problem | OneNoughtOne