## 3 Experimental Setup and Protocol
### Policy Parameter Space and Latent Space  
In our experiments, we represented a throwing trajectory with a Cartesian space dynamic movement primitive (CDMP) [42]. Thus, the full parameter space of throwing trajectories is defined by the free CDMP parameters. CDMPs encode the motion of each robot degree of freedom with a nonlinear dynamic system. While positions are encoded in the same manner as, for example, joint space trajectories (see [43]), Cartesian space orientations in the form of unit quaternions are encoded differently in order to maintain the unit norm [42]. The free CDMP parameters consist of the starting position \(\mathbf{p}^{0}\) and orientation \(\mathbf{\sigma}^{0}\), weights defining the dynamic of motion for the position and orientation \(\mathbf{w}_{k}^{p}\), \(\mathbf{w}_{k}^{o}\in\mathbb{R}_{\cdot}^{3}\), \(k=1,\ldots,N\), trajectory duration \(\tau\), and the final (desired) position \(\mathbf{g}^{p}\) and orientation \(\mathbf{g}^{o}\) of the robot arm motion. If, for example, the number of weights is \(N=25\) (this is usually sufficient for good accuracy, see in [9]), we obtain a 165 dimensional parameter space. For clarity, we provide a short recap of CDMPs in Appendix A. Further details are available in [42]. The application of neural networks for the generation of dynamic movement primitives has been analyzed in detail in our previous work [44].  
In our experiments, throwing is a planar problem in the \(x-z\) plane. Thus, only three Cartesian space degrees of arm motion must be specified: the positional motion along the \(x\) and \(z\) axis and the rotational motion around \(y\) axis. The other three degrees of freedom are fixed. In our experiments, we also kept constant the initial and goal position of the arm motion (position and orientation of the throwing spoon). Thus, the throwing movement always starts and ends in the same poses. The relevant DOFs and their parameters are the following.  
\[\mathbf{\theta}^{\text{CDMP}}=\begin{bmatrix}\mathbf{w}_{x}^{T},\mathbf{w}_{z}^{T},\mathbf{w}_ {roty}^{T},\tau\end{bmatrix}^{T}. \tag{7}\]  
By setting the number of weights to \(N=25\), the dimension of the policy space becomes \(d_{\text{CDMP}}=76\).  
We applied an autoencoder neural network to further reduce the dimensionality of the full CDMP parameter space. The parameters specified in Equation (7) represent the inputs and outputs of the autoencoder network. The autoencoder structure depends on the task and the manner in which the data are encoded. It needs to be chosen in such a way that the difference between training inputs and outputs is as low as possible. Typically, the autoencoder network structure is empirically determined by the network designer, keeping in mind the potential of vanishing or exploding gradients [45].  
In our experiments, the autoencoder network was a fully connected, 5-layered neural network with 76-20-L-20-76 neurons. This means that there were 3 hidden layers with 20, L, 20, neurons. In order to determine the appropriate latent space layer, we varied L between 2 and 10. Section 4.1 provides the results of the autoencoder network approximation depending on the dimension of the latent space and the number of samples used in the training process. Figure 3 shows an illustration of the used autoencoder structure, but keep in mind that we varied the number of latent space neurons.  
Figure 2: Image sequence of a throw in GAZEBO simulation environment.