In this talk, we present the novel implementation of a non-differentiable metric approximation with a corresponding loss-scheduling based on the minimization of a figure-of-merit related function typical of particle physics (the so-called Punzi figure of merit). We call this new loss-scheduling a "Punzi-loss function" and the neural network that minimizes it a "Punzi-net". We tested the Punzi-net on simulated samples of signal and background at the Belle II experiment. We show that in the search for new particles of unknown mass, for example, a new Z’ boson, the Punzi-net outperforms standard multivariate analysis techniques and generalizes well to mass hypotheses for which it was not trained. This work constitutes a further step towards fully differentiable analyses in particle physics.