Hello Hassan,
yes computing the inverse of a map is in general more expensive than evaluating the map. The evaluation of a generic non-linear map \(S\) is given by:
$$ S({\bf x})=\left[\begin{array}{l}
S_1(x_1)\\
S_2(x_1, x_2)\\
\;\vdots\\
S_d(x_1,\ldots,x_d)
\end{array}\right]$$
The inverse instead requires \(d\) rootfinding to be computed, one for each component \(S_i\):
$$ S^{-1}({\bf y})=\left[\begin{array}{l}
S_1^{-1}(y_1)\\
S_2^{-1}(S_1^{-1}(y_1), \cdot)(y_2)\\
\;\vdots\\
S_d^{-1}(S_1^{-1}(y_1),\ldots,\cdot)(y_d)
\end{array}\right]$$
where each rootfinding is done along the last dimension (you can see the monotonicity constraint coming handy when doing these rootfidings). The class InverseTransportMap is just a wrapper around \(S\), so it wouldn't help.
In order to speed-up the computation of the inverse there are two available routes:
- Use MPI: the computation can be performed for each point separately. You can take a look at the MPI section of the tutorial.
- The alternative (if you really have to use this inverse again and again) is to solve the regression problem
$$ T = \arg\min_{T} \Vert T({\bf x}) - S^{-1}({\bf x}) \Vert_{\mathcal{N}(0,{\bf I})} $$
You can look for the API documentation of the regression function.
Once the map \(T\) is found, then you can just evaluate it on all your points and that should be way faster.
Let me know if you have any additional doubt and I can write down a couple of working examples.