During training, we sample a batch of source-target molecule pairs and compute the regularization term in Equation for the all the molecular pairs included in the batch. Figure depicts an example of the ranking loss calculation. Finally, to train the model we propose the following loss function as a combination of Equations 1 and 2