  Merging is potentially the dominate process in galaxy formation, yet there is
still debate about its history over cosmic time. To address this we classify
major mergers and measure galaxy merger rates up to z $\sim$ 3 in all five
CANDELS fields (UDS, EGS, GOODS-S, GOODS-N, COSMOS) using deep learning
convolutional neural networks (CNNs) trained with simulated galaxies from the
IllustrisTNG cosmological simulation. The deep learning architecture used is
objectively selected by a Bayesian Optmization process over the range of
possible hyperparameters. We show that our model can achieve 90% accuracy when
classifying mergers from the simulation, and has the additional feature of
separating mergers before the infall of stellar masses from post mergers. We
compare our machine learning classifications on CANDELS galaxies and compare
with visual merger classifications from Kartaltepe et al. (2015), and show that
they are broadly consistent. We finish by demonstrating that our model is
capable of measuring galaxy merger rates, $\mathcal{R}$, that are consistent
with results found for CANDELS galaxies using close pairs statistics, with
$\mathcal{R}(z) = 0.02 \pm 0.004 \times (1 +z) ^ {2.76 \pm 0.21}$. This is the
first general agreement between major mergers measured using pairs and
structure at z < 3.
