  The present work addresses the challenge of training neural networks for
Dynamic Initial Margin (DIM) computation in counterparty credit risk, a task
traditionally burdened by the high costs associated with generating training
datasets through nested Monte Carlo (MC) simulations. By condensing the initial
market state variables into an input vector, determined through an interest
rate model and a parsimonious parameterization of the current interest rate
term structure, we construct a training dataset where labels are noisy but
unbiased DIM samples derived from single MC paths. A multi-output neural
network structure is employed to handle DIM as a time-dependent function,
facilitating training across a mesh of monitoring times. The methodology offers
significant advantages: it reduces the dataset generation cost to a single MC
execution and parameterizes the neural network by initial market state
variables, obviating the need for repeated training. Experimental results
demonstrate the approach's convergence properties and robustness across
different interest rate models (Vasicek and Hull-White) and portfolio
complexities, validating its general applicability and efficiency in more
realistic scenarios.
