Each stage has its corresponding loss function. In the Particle Movement stage, the goal of the f pm model is to move VPs to the positions of the template molecule atoms so that the distribution of VPs approximates the atomic distribution of the molecule. Each VP is directly assigned a real atom as a training target. Following the principle of least action , assigning each VP to the nearest real atom as the training target is the optimal choice. Given the real atomic distribution: