A block-random algorithm for learning on distributed, heterogeneous data