Minimizing the distance function is a nonlinear optimization problem for which generally no analytical solution exists, in particular, for embodiments with a large number of links. Using mathematical libraries such as TensorFlow, the gradient of the distance function can be computed and local minima can be found numerically via gradient descent.
Instead of trying to solve the optimization problem repeatedly for each input, we can learn a mapping from joint angles of the expert to joint angles of the learner \(\mathbf {f}_{\mathbf {\theta }}: \mathbf {q} \longrightarrow \hat{\mathbf {q}}\) , where \(\mathbf {q} \in [-\pi , \pi ]^{n}\)  and \(\hat{\mathbf {q}} \in [-\pi , \pi ]^{\hat{n}}\) .
The function \(\mathbf {f}_{\mathbf {\theta }}\)  can be approximated by a neural network with weight parameters \(\mathbf {\theta }\) . The distance measure was implemented as a computation graph in TensorFlow [1]}.
<FIGURE>