speeding up alphas, moving alphas,betas and Z to sgd update function because that's all that needs it