Fast stochastic algorithms for machine learning