Stochastic gradient descent and the randomized Kaczmarz algorithm