Implementation of machine learning framework not working with fix_box_relax

That makes sense. In the new code that I’ve been working on however, potential energy is calculated via a second ML model (so one for force and the other for energy). If this still has a problem with the minimizers then that would mean that the energy is being tallied incorrectly? In the event that I need to calculate the forces first, and then the energy second, outside of the main loop over the atoms, (and it’s the total potential energy, not the sum of atomic energies), what’s the best way to tally those values up?