Finally, we performed the KRR method to fit the machine learning dipoles based on the final training dataset, and then we tested their prediction ability based on the testing dataset. The parameters σ and λ in the training process were set to 0.05 and 0.005 to get the smallest training and test errors. After obtaining the machine-learned dipoles, we get their derivatives using Eq. 52. All the machine learning relevant codes, such as KRR, data prescreening, and the interface with dynamics, were written with the Python language, based on the scikit-learn toolkit.