Stabilizing PDE--ML coupled systems