Template libraries were constructed by filtering the respective dataset for templates that occurred a minimum of N times. In all cases duplicate reactions were removed prior to filtering. Products were represented as extended connectivity fingerprints (ECFP) with a radius of 2, using the Morgan algorithm in RDKit. Whereas, templates were represented as binarized labels in a one-vs-all fashion using the scikit-learn library using the 'LabelBinarizer'. Both the input ECFP4 and output vectors were precomputed. Training, validation, and test sets were constructed as a random 90/5/5 split of the datasets, using a random state of 42, where the datasets were shuffled prior to splitting. This was conducted using the scikit-learn library. The policy networks framed as supervised multiclass classification problems were trained using Keras with Tensorflow 48 as the backend, the Adam optimizer with an initial learning rate of 0.001, and categorical cross entropy as the loss function. The learning rate was decayed on plateau by a factor of 0.5, where the plateau was considered as no improvement of the validation loss after 5 epochs. The