## 2 Methods and Data Acquisition for Learning
### Database Acquisition by Generalization  
As in all neural networks, autoencoders also require a large amount of samples for training. Obtaining such an amount of samples with a robot is a time-consuming job that causes too much wear and tear of the equipment and might even damage the robot itself. One way to address these issues is to gather data in simulation. However, there is always a discrepancy between the simulation dynamics and the real system. The main contribution of this paper is a way to synthetically form the training samples without the need for many thousands of repetitions with a real system.  
To compute the autoencoder network defining the AE-based latent space, we must first acquire a training dataset of robot motion trajectories  
\[\{\theta_{i}\}_{i=1}^{N_{s}}, \tag{4}\]  
where \(N_{s}\) is the number of trajectories and \(\theta_{i}\) are the parameters representing the \(i\)-th trajectory. The trajectories can be acquired either in simulation or in the real world. The former does not require task executions with a real robot but might result in an inaccurate description of the task because no model is fully accurate. Moreover, it is sometimes difficult to construct mathematical models needed to generate simulated data. The latter will faithfully describe the behavior, but requires many task executions with a real robot, which is very time-consuming, to the point that it might not be practically feasible.  
In this paper, we propose a new approach to generate data for learning autoencoders using statistical generalization methods, e.g., Gaussian Process Regression (GPR) [39]. The idea is to start by collecting a relatively small number of task executions with a real robot and then apply GPR to generate a larger set of synthetic data based on the available real data. Among many possible statistical learning methods, we selected GPR because it has been demonstrated [39] that in many practical problems GPR achieves better performance than other methods for robot learning. For example, GPR has been shown to be effective when estimating the inverse dynamics of a seven DOF robot arm [40].  
Let us assume that the robot performed a relatively small number of tasks. We denote the associated movements and task descriptors as \(\mathbf{\theta}_{i}\) and \(\mathbf{q}_{i}\), respectively. From these data we form a dataset  
\[\mathcal{D}=\{\mathbf{\theta}_{i},\mathbf{q}_{i}\}_{i=1}^{N_{s}}. \tag{5}\]  
New data points can be generated by selecting a new desired task descriptor \(\mathbf{q}_{d}\) and computing the associated motion policy by GPR, i.e.,  
\[\mathbf{G}(\mathcal{D}):\mathbf{q}_{d}\rightarrow\mathbf{\theta}_{d}. \tag{6}\]  
For the sake of completeness, we provide the formulas to implement GPR in Appendix B.  
Note that it is not necessary to execute the task with the robot or to simulate the task execution in a simulation system when generating new data couples \(\mathbf{\theta}_{d}\), \(\mathbf{q}_{d}\). Thus new data can be computed very efficiently. The robot only executes a few shots at different targets while the rest of the data are generated by GPR. Our assumption, which is confirmed in our experiments, is that the training data obtained with this approach will perform as well or better than the data obtained in simulation. Consequently, a better initial approximation reduces the number of RL iterations.