We propose a new algorithm for variance reduction when estimating f(XT) where X is the solution to some stochastic differential equation and f is a test function. The new estimator is (f(X1T)+f(X2T))/2, where X1 and X2 have same marginal law as X but are pathwise correlated so that to reduce the variance. The optimal correlation function ρ is approximated by a deep neural network and is calibrated along the trajectories of (X1,X2) by policy gradient and reinforcement learning techniques. Finding an optimal coupling given marginal laws has links with maximum optimal transport.