Training machine learning algorithms using actor framework in multi-core or cluster system