Ultimately, the model predictions Q NN element-wise multiplied with p enter the loss function, and from the resulting (N c × 2 N S -1 )-matrix, the column giving the lowest loss value is handed to the ML model and further optimized. The respective phase-free loss function -implemented as spainn.loss.PhysPhaseLossAtomistic -reads as