  An efficient and robust on-the-fly machine learning force field method is
developed and integrated into an electronic-structure code. This method
realizes automatic generation of machine learning force fields on the basis of
Bayesian inference during molecular dynamics simulations, where the first
principles calculations are only executed, when new configurations out of
already sampled datasets appear. The developed method is applied to the
calculation of melting points of Al, Si, Ge, Sn and MgO. The applications
indicate that more than 99 \% of the first principles calculations are bypassed
during the force field generation. This allows the machine to quickly construct
first principles datasets over wide phase spaces. Furthermore, with the help of
the generated machine learning force fields, simulations are accelerated by a
factor of thousand compared with first principles calculations. Accuracies of
the melting points calculated by the force fields are examined by thermodynamic
perturbation theory, and the examination indicates that the machine learning
force fields can quantitatively reproduce the first principles melting points.
