  Complex contour deformations of the path integral have been demonstrated to
significantly improve the signal-to-noise ratio of observables in previous
studies of two-dimensional gauge theories with open boundary conditions. In
this work, new developments based on gauge fixing and a neural network
definition of the deformation are introduced, which enable an effective
application to theories in higher dimensions and with generic boundary
conditions. Improvements of the signal-to-noise ratio by up to three orders of
magnitude for Wilson loop measurements are shown in $SU(2)$ lattice gauge
theory in three spacetime dimensions.
