K-means avoided in gradient descent method