Optimal control of quantum thermal machines using machine learning | Synapse