core structure for the gradient descent