added function to get changed weights for gradient descent