Machine learning driven simulated deposition of carbon films: From low-density to diamondlike amorphous carbon