  We present a generic path-dependent importance sampling algorithm where the
Girsanov induced change of probability on the path space is represented by a
sequence of neural networks taking the past of the trajectory as an input. At
each learning step, the neural networks' parameters are trained so as to reduce
the variance of the Monte Carlo estimator induced by this change of measure.
This allows for a generic path dependent change of measure which can be used to
reduce the variance of any path-dependent financial payoff. We show in our
numerical experiments that for payoffs consisting of either a call, an
asymmetric combination of calls and puts, a symmetric combination of calls and
puts, a multi coupon autocall or a single coupon autocall, we are able to
reduce the variance of the Monte Carlo estimators by factors between 2 and 9.
The numerical experiments also show that the method is very robust to changes
in the parameter values, which means that in practice, the training can be done
offline and only updated on a weekly basis.
