adding py file for sgd