Simulating microorganisms with machine learning