Parameters for > 300 million Gaia stars: Bayesian inference vs. machine learning