{'fraction_non_alphanumeric': 0.03137281171847088, 'fraction_numerical': 0.007257056091461236, 'mean_word_length': 4.8719024518159175, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inferring Versatile Behavior from Demonstrations by Matching Geometric Descriptors

Humans intuitively solve tasks in versatile ways, varying their behavior in terms of trajectory-based planning and for individual steps. Thus, they can easily generalize and adapt to new and changing environments. Current Imitation Learning algorithms often only consider unimodal expert demonstrations and act in a state-action-based setting, making it difficult for them to imitate human behavior in case of versatile demonstrations. Instead, we combine a mixture of movement primitives with a distribution matching objective to learn versatile behaviors that match the expert's behavior and versatility. To facilitate generalization to novel task configurations, we do not directly match the agent's and expert's trajectory distributions but rather work with concise geometric descriptors which generalize well to unseen task configurations. We empirically validate our method on various robot tasks using versatile human demonstrations and compare to imitation learning algorithms in a state-action setting as well as a trajectory-based setting. We find that the geometric descriptors greatly help in generalizing to new task configurations and that combining them with our distribution-matching objective is crucial for representing and reproducing versatile behavior.


Introduction
Imitation Learning (IL) [1,2,3] from human demonstrations is challenging as humans often solve tasks in versatile ways. Even the same person might solve a task differently when confronted with it multiple times. Behavior can be versatile in terms of task-level decisions, such as planning a route to a target, and individual actions, such as randomly pausing during a movement to think about the next steps. Most recent IL approaches [4,5,6,7] model the behavior in state-action space using Gaussian policies, which assumes the behavior is unimodal and cannot capture this planning versatility. Yet, this assumption is violated by most human expert datasets, often causing poor generalization to human demonstrations [8]. Additionally, IL approaches often need immense amounts of data to achieve generalization [9,8]. We tackle these challenges by a feature matching approach to IL that is able to generalize to novel contexts from a small amount of expert demonstrations. Such contexts are (typically low-dimensional) vectors that describe a specific task configuration within a family of related tasks, such as e.g., the coordinates of goal locations to reach. The resulting approach, Versatile Imitation from Geometrically Observed Representations (VIGOR), models distributions that match expert trajectories in terms of concise geometric behavioral descriptors. VIGOR represents distributions using Gaussian Mixture Models (GMMs) over Probabilistic Motion Primitives (ProMPs) [10], and utilizes descriptors that are designed to abstract away from concrete contexts and thus facilitate generalization to novel contexts in a sample-efficient way. An example of such descriptors would be geometric features in the form of (only) the distance between a target + ⇒  and the robot's end-effector, plus features that denote the smoothness of the robot. While similar behavioral descriptors have found use in Inverse Optimal Control [11,12] to recover cost functions from demonstrations, common IL approaches instead use state representations that include both relative and absolute information [5,13]. The exact form of this set of behavioral descriptors is task-dependent and allows the user to include domain knowledge. Figure 1 shows how VIGOR works on an exemplary reaching task. For training the GMMs, we rely on recent approaches [14,15,16] for distribution matching and Variational Inference. For inference, we train individual GMMs for each training context and an arbitrary number of test contexts.
We evaluate VIGOR on a suite of versatile robotic tasks, where demonstrations are collected from human experts through teleoperation. We compare our method to standard Behavioral Cloning (BC) [17], BC with a GMM policy [13,18], Generative Adversarial Imitation Learning (GAIL) [5] and Inverse Reinforcement Learning (IRL) techniques [7]. We find that these methods either fail to learn useful behavior because they average over multiple solutions, or that they are unable to capture the full versatility of the demonstrations. Contrary to this, VIGOR accurately models highly versatile behavior from already a small number of trajectories demonstrated by human experts. We perform extensive ablation studies to showcase the importance of different parameters and design choices. Datasets and code can be found at https://www.github.com/NiklasFreymuth/VIGOR.
To summarize, our list of contributions is as follows: • We infer multi-modal distributions of desired trajectories from highly versatile human expert trajectories by matching distributions over behavioral descriptors between learner and expert.
• Our approach is, to the best of our knowledge, the first Adversarial Imitation Learning method to utilize concise behavioral descriptors to facilitate generalization to novel contexts from already a small number of demonstrations.
• We conduct experiments with human demonstrations in simulation and on a real robot and find that VIGOR accurately models highly versatile human behavior, outperforming various Imitation Learning baselines.

Related Work
Imitation Learning for Skills. A common way to represent skills over trajectories is via Movement Primitives (MPs) [19,10]. While learning individual MPs from human demonstrations is a simple regression problem, modeling versatile behavior requires a more sophisticated model that can represent such multi-modality, e.g., a mixture model. Using Expectation Maximization (EM) [20], both [21] and [22] fit a single GMM over MP parameters of multiple demonstrations for different contexts and use them to generalize to novel contexts by conditioning. Yet, as they only fit a single GMM for all contexts, they do not explicitly focus on representing versatility. Recent work [23] instead learns a mixture over contextualized MPs using Gaussian Mixture Regression. This has been extended to non-linear relations between MP parameters and context [18] by using Mixture Density Networks (MDNs) [24]. While the above approaches work for tasks with a small number of modes, optimizing MDNs can be challenging in the case of many modes in the demonstrations. Osa et al. [25] use planning algorithms to reproduce human demonstrations in a trajectory-based setting. They tune the parameters of a cost function such that the planned trajectories match the demonstrations and use the extracted cost function to guide the trajectory optimization process. Yet, this approach is limited to uni-modal demonstrations and requires engineered cost functions.
Imitation Learning by Distribution Matching. Classical IL approaches [26,27] employed feature expectation matching to learn a policy from behavioral descriptors of expert demonstrations. Similarly, a recent body of work [11,12] in Inverse Optimal Control utilizes geometric behavioral descriptors that are similar to ours to learn cost functions for manipulation tasks from a few demonstrations. Whereas these approaches linearly match the moments/expectations of their features, our method instead matches a versatile distribution over non-linear features using the reverse Kullback-Leibler Divergence (KL) [28]. Directly matching the distribution rather than its moments means that our method can represent complex and multi-modal distributions. More recently, a new class of distribution matching approaches has gained popularity with the advent of Generative Adversarial Nets [29]. Starting from GAIL [5], a whole class of distribution matching based IL approaches was developed [4,30,31,32,33,34]. All of these approaches commonly work in a step-based setting and minimize some divergence between the state-action occupancy or state marginals. They generally do not consider versatile behavior, and additionally need to interact with the environment during training in order to generate states to match. We instead work in a trajectory-based setting , which allows us to abstract away the environment's dynamics and learn entirely offline, i.e., without any environment interactions. Common methods in this setting usually employ a maximum likelihood approach, which, as previously discussed, performs poorly on versatile data. As a solution to this problem, Becker et al. [16] propose using the Information-Projection [35] instead, which is able to focus on individual modes of data rather than averaging over all modes of data. This approach has been extended to IRL [36]. Here, we build on these methods, generalizing them to sequential data and geometric behavioral descriptors.
Comparison-Based Approaches. Brown et al. [6] perform IRL by utilizing provided rankings of demonstrations to train a discriminator on a comparison-based loss. As the discriminator learns to favor samples with a high rank, it can be used as a reward function after training. This has been extended by Disturbance-based Reward Extrapolation (D-REX) [7], which automatically generates rankings by fitting a BC policy on the demonstrations and subsequently draws samples with different levels of noise from this policy. We adapt D-REX to our trajectory-based setting as a baseline. Similar to VIGOR, this adapted method trains a model on expert demonstrations on training contexts to optimize GMM policies on novel test contexts. However, while D-REX learns a reward function to do so, VIGOR iteratively (re-)trains a discriminator on the expert demonstrations and policy samples.

Foundations
In this section, we briefly cover the foundations and previous work that our method builds on.
Probabilistic Movement Primitives. For a trajectory τ = (τ 1 , · · · , τ T ), ProMPs represent the elements as τ t = Φ(t) T w, where τ t represents a vector of the desired joint angles at time-step t [18] Note that w does not depends on t and that τ can thus be computed at an arbitrary resolution T . Here Φ(t) are time-dependent features, usually radial basis functions centered around different time points, and w denotes the parameter vector. For a single demonstration, the parameters w are fitted using simple linear regression and compactly represent the entire trajectory.  Figure 2: Schematic of VIGOR. We generate a set of expert trajectories from human demonstrations and then transform them into geometric behavioral descriptors. These descriptors are then fed into a discriminator. This process is repeated for samples of a separate GMM policy for each training and test context. We then train the discriminator to distinguish between human and policy trajectories. The geometric descriptors are designed to abstract away from concrete task configurations, causing the discriminator to distinguish how well a trajectory performs rather than which context it acts on. As a result, the discriminator can be used to improve the policies.
Variational Inference for Gaussian Mixture Models. We build on a recent class of efficient Variational Inference approaches that allow modeling versatile behavior with GMMs [16,14]. These approaches use the Information-Projection [35] to minimize the reverse Kullback-Leibler Divergence KL q(w)||p(w) between a model q(w) and a target distribution p(w). In our case, p(w) is the distribution of expert trajectories. Arenz et al. [14] introduced an upper-bound objective based on a variational decomposition. The resulting approach, Variational Inference by Policy Search (VIPS) [14,15], repeatedly solves the objective whereq denotes the model from the previous iteration. This objective decomposes into individual optimizations for the components and categorical distributions, which Arenz et al. [14] solve using trust-region methods from policy search [37,38].
Distribution Matching for Gaussian Mixture Models. We cannot directly work with VIPS, as we do not know p(w) but only have the expert demonstrations. To address this issue, Becker et al. [16] propose using density ratio estimation [39] approaches to approximate the log(q(w)/p(w)) term in Equation 1, removing the dependency on p(w). Specifically, they use logistic regression to estimate the density ratio. The resulting approach, Expected Information Maximization (EIM), resembles Generative Adversarial Nets [29] where the discriminator effectively also estimates a density ratio.

Inferring Versatile Behaviors by Matching Geometric Descriptors
Our approach estimates versatile behavior in form of GMM distributions over ProMP weights for all training and test contexts of the given task. We note that while this setup requires the test contexts in advance, it does not need interaction with the real environment since the behavioral descriptors are directly computed from the proposed trajectory and its context. To capture correlations in the demonstrations, we utilize full-covariance GMM components. For each planned trajectory, we compute concise descriptors such as distances to key-points that isolate the performance of the trajectory from its context to allow for sample-efficient generalization to novel contexts. We then build on EIM [16] and use a discriminator to infer GMMs from demonstrations by matching the learner's and expert's distributions in the resulting geometric feature space. Towards this end, we generalize EIM to sequential data and modify the policy parameterization to accommodate for our setting. Figure 2 illustrates an overview of our approach. We provide pseudocode in Appendix A.
Context-Specific Mixture Policies We want to model the expert's behavior for a given small set of training configurations of the task, denoted as training contexts c train , and a set of unseen test contexts c test . We consider the set of all contexts as c = c train ∪ c test . As context-dependent GMMs 2 are hard to learn and we assume a relatively small amount of training contexts, 6 in all our experiments, with multiple demonstrations per training context, we resort to maintaining a single GMM-Policy q c (w) for each context c. This non-amortized formulation simplifies the policy updates as we can optimize the policy for each context individually, given the density ratio estimator, using highly efficient, tailored methods for full-rank GMM approximations [14,15].

Distribution Matching of Behavioral Descriptors
We assume access to behavioral descriptors O = f c (w) that represent features encoded in the parameter vector w with respect to the context c of w. For simplicity, we will assume that the mapping f c between w and O is deterministic, such that we can easily evaluate O for any desired plan w. We want to match the distribution of behavioral descriptors of the demonstrator while optimizing for q(w), i.e, where p(O|w) is a Dirac delta distribution defined by the mapping f c and q(O) = p(O|w)q(w)dw.
As the mapping between w and O is deterministic, the EIM algorithm can be directly applied to this setup with the difference that the discriminator is trained using O instead of w. Moreover, while we a learn different distributions q c (w) for each context c, we use the same discriminator for all contexts. This way, we can infer distributions {q c (w)|c ∈ c test }, i.e. infer versatile trajectories for unseen scenarios.

Density Ratio Estimation for Sequential Behavioral Descriptors
at convergence [39]. However, this cost function only provides a single training sample per trajectory and is therefore hard to use for a small number of demonstrations. By utilizing the sequential structure of the trajectories, the classification error can be computed for each time-step, i.e. we minimize w.r.t. φ(O). Finally, we train an ensemble of discriminators instead of a single one, using their average logit as the log density ratio estimate for the policy updates. For the network architecture, we find that simple 2−4 layer 1d convolutional neural networks (1d-CNNs) work best in our experiments. We compare this choice to other sequential network architectures the ablations in Appendix D.
Geometric Behavioral Descriptors VIGOR utilizes geometric descriptors that abstract away from a concrete task configuration to generalize to new configurations. To this end, we encode the current state along the desired trajectory with respect to relative geometric features rather than absolute values. The resulting geometric descriptors cause trajectories of similar performance to appear similar in feature space regardless of their context, allowing for sample-efficient generalization to novel contexts. We note that such a descriptor space can often be straightforwardly constructed from the geometry of the task by composing distances of the end-effector to key-points of the objects in a scene. For example, in object manipulation, this space can be composed of distances of the end-effector to the corners of a box to push.

Experiments
All experiments use human demonstrations. The tasks were selected due to their highly multi-modal nature and because they allow for an easy collection of human demonstrations. We instructed the demonstrators to solve the task in varying ways to create versatile solutions. As a preprocessing step, we fit a ProMP for each human demonstration and filter the resulting ProMPs such that only successful demonstrations remain. This step ensures that the human demonstrations can be imitated by the learner and conveniently allows to compress all demonstrations to a fixed length in a principled fashion. We use the resulting preprocessed expert demonstrations for all experiments unless otherwise stated. Similarly, unless noted otherwise, all experiments use 6 training and 6 test contexts, and 5 GMM components for each configuration and method. Experimentally, this number of components is sufficient for matching the distribution of expert descriptors for the considered tasks, whereas more components generally only lead to spurious improvements. We experiment with less components in the ablations in Appendix D. Unless noted otherwise, we do not train the categorical distribution of the GMM components, using a uniform distribution instead. We evaluate the GMM policies using a number of samples for each component of each test context, and then rank these components according to the average performance of their samples. We then report statistics of the best component of the resulting value over the random seeds. Note that reporting the best component leads to a fair comparison to unimodal approaches. For baselines that do not use GMM policies, we instead draw samples of the trained policies for each test context and average the performance of all of them. For each experiment, we report a measure of how well the task is performed in the main paper, and additional success rates in Appendix C. We repeat each experiment for 10 random seeds. Appendix E shows all hyperparameters and training details.
Baselines. We compare VIGOR to a number of IL baselines, using three state-action baselines, namely GAIL [5], behavioral cloning (BC(S)) and behavioral cloning with a GMM policy (BC-GMM(S)) [13]. For all experiments, the state-action baselines receive geometric descriptors of the current state and a time-step as state information, and output the velocities of the robot joints as actions. Further, we also consider three trajectory-based methods. These are standard behavioral cloning (BC(T)), behavioral cloning with a GMM policy (BC-GMM(T)) (see e.g., Zhou et al. [18]), and a modified version of D-REX (EM+D-REX). The latter is chosen due to its similarities to VIGOR, which are detailed in Appendix B.1. We refer to Appendix B for details on the baselines and to Appendix C for further results on all experiments described below.
Planar Reacher. First, we consider the introductory task shown in Figure 1. In this task, the goal is to reach an intermediate target area with the end-effector of a 5 Degrees of Freedom (DoF) robot with joints of length 1 before ending the trajectory in a final target area. The geometric descriptors for this task are given by the euclidean distance of the end-effector to both targets, paired with the average velocity and acceleration of the joints to encode the smoothness of the motion. This yields a total of 4 features per time-step. The left and middle panels of Figure 1 depict example demonstrations for two training contexts (top) and the corresponding distances between the end-effector and targets over time (bottom). We explore other choices for the geometric descriptors in the ablations in Appendix D. For evaluation, we use the Distance to Boundaries of the target areas. For the first target, we consider the minimum distance of the end-effector to the boundary; for the second target, we consider the distance at the last time-step. We train all methods on 5 demonstrations per training context. The left of Figure 3 shows results on test contexts. We find that only VIGOR and EM+D-REX can consistently get close to both targets. Yet, EM+D-REX can only learn a single mode and fails to reproduce the versatility of the demonstrations. We investigate this in more detail in Appendix C.1.

7-D Panda
Reacher. We repeat the above point-reaching task using a 7 DoF Franka Emika Panda robot and 3-D intermediate and goal positions. Since we do not care about the end-effector's rotation, the last DoF can be ignored, leading to an effective action dimension of 6. We use 8 basis functions per action dimension for the MPs, leading to a total of MP dimension of 48 and thus a high-dimensional problem space. The expert demonstrations are collected using a teleoperation setup with a virtual twin that records joint values over time. Appendix C.2 explains the setup in more detail. We use the same geometric descriptors as for the planar reacher task. The right of Figure 3 shows target distances on test contexts. Similar to the previous task, only VIGOR and EM+D-REX can consistently get close to both targets while the other methods regularly fail to pursue at least one of the two targets.
Box Pusher. We also evaluate our approach on a contact-rich robot manipulation task. In this task, a simulated Franka Emika Panda robot has a rod attached to its end-effector and needs to use it to push a rectangular box to a given goal position and orientation. The box always starts at the same position, and the task context is given by the desired (x, y) translation of the box, plus its desired rotation in degrees. For simplicity, the task is learned in task space with a fixed height. The demonstrations contain the starting position of the robot as well as its trajectory. Here, the solutions are versatile Similarly, using a discriminator to iteratively optimize the policies is advantageous on the reaching tasks, as seen from VIGOR and GAIL. Finally, the clear distribution matching objective of VIGOR and EM+D-REX seems crucial for imitation from a low number of versatile demonstrations. VIGOR uniquely combines the above properties and is able to reliably reach both targets for both tasks. VIGOR is able to consistently push the box to the right configuration. Opposed to this, the other methods only marginally improve over the initial box positions, and in some cases perform worse than it. (Right) We find that VIGOR benefits most from additional training contexts, almost matching the performance of the demonstrator on unseen contexts for 24 training contexts.
because the box can be pushed both from the inside and outside. The geometric descriptors consist of the (x, y) distances of the end-effector to the initial and desired final position of the corners of the box. To facilitate generalization between contexts, we translate the basis of these distances such that the desired final box aligns with the origin of the coordinate system. We additionally add the end-effector velocity and acceleration as well as the time-step, resulting in 19 features per time-step. This geometric description of the task allows for IL without simulating or explicitly modeling the box, significantly speeding up the training process and facilitating generalization to both new contexts and real-world robots. We use 3 demonstrations per training context and evaluate the average distance of the corners of the final box to that of the desired final position. The contact with the box causes a mismatch between a planned trajectory and its execution on the robot, which we illustrate in Appendix C.3. Results are shown in the left of Figure 4. Additionally, the right of Figure 4 shows how the performance varies when changing the number of training contexts. Finally, we illustrate how the planned trajectories of VIGOR perform on a real robot. To this end, we create a real-world replica of the simulated box that the robot manipulates. Rollouts for different policy components of VIGOR trained on 24 training contexts on an exemplary test context are shown in Figure 5. Ablations. We conduct extensive ablation studies to investigate how our design choices affect our approach. We find that a concise choice of behavioral descriptors, a preprocessing of the expert demonstrations to ProMPs, and a 1d-CNN discriminator are crucial for performance. We also notice that the policy benefits from additional components and that we see modest improvements for an ensemble of discriminators and the stepwise loss proposed in Equation 3. We refer to Appendix D for the full results and more thorough ablations of both VIGOR and EM+D-REX.

Limitations
Scale. We currently train and maintain a separate GMM over ProMP parameters for each context, leading to linear space and time complexity w.r.t. the total number of contexts. One way to address this challenge would be to instead train a joint Mixture Density Network q(w|c) over all contexts, which is left for future work. Additionally, representing trajectories with a single ProMP limits them to single smooth movements. To alleviate this, MP chaining [40,41,42] can be straightforwardly integrated into our approach to allow for the representation of more complex movements Geometric Descriptors. VIGOR facilitates generalization to novel task configurations by using geometric descriptors. While this allows the user to include domain knowledge, it also requires a clear idea about which aspects of the task are important. Instead, geometric descriptors could be automatically extracted from the task for example by using NNs processing point clouds [43,44].
Re-training. Finally, our method assumes that the test configurations c test are known in advance.
Since the test configurations are optimized jointly with the training configurations, the only way to integrate new test configurations is to re-train the algorithm. In the future, we want to alleviate this issue by recovering a reward representation from ranked intermediate policies of the given training configurations, essentially combining our approach with some of the ideas of D-REX.

Conclusion
We proposed VIGOR, a novel feature-matching approach to Imitation Learning in environments with versatile solutions. Utilizing a combination of movement primitives, mixture policies and matching geometric behavioral descriptors, our method can closely imitate the behavior distribution of human experts from a few demonstrations. We show the effectiveness of our approach on a suite of challenging robot coordination tasks. The results show that VIGOR is able to closely match the distribution of the demonstrator, outperforming the chosen baselines in all considered settings. c |c ∈ c train } Input: Initial Policies {q c (w)|c ∈ c} Output: Converged Policies {q c (w)|c ∈ c} 1 n samples ← |O (p) |/|c| 2q c (w) ← q c (w) ∀c ∈ c 3 while not converged do 4 Gather new policy samples Update policies for each context with discriminator φ(O) (c.f. Eq. 1, ) 15 for c ∈ c do 16 q c (w) ← arg min

A Pseudocode
Pseudocode for VIGOR is provided in Algorithm 1.

B Baselines
We compare VIGOR to a number of strong IL baselines in both a trajectory-based and state-action setting.

B.1 EM+D-REX
We modify Disturbance-based Reward Extrapolation (D-REX) [7], a state-of-the-art IL algorithm to work in a trajectory-based setting and with a GMMs policy. For this, we first use EM to fit a GMM with a small number of components on each configuration in c train , and use the resulting distributions to draw samples for the D-REX reward. To generate the rankings required by D-REX, we multiply the covariance of each component of the resulting GMM with different scalars, resulting in GMMs with different noise levels. More precisely, we fit the EM-GMM on the samples, and multiply its component-wise covariance with a Base Noise σ base to get an initial distribution. We repeat this process for a number of Noise Levels, linearly increasing the noise up to σ base · λ max , where we call λ max the Noise Multiplier. We then draw samples from each noise level of the GMMs corresponding to each context in c train and rank them against each other using the comparison-based loss of D-REX, where samples drawn from a lower noise level are ranked higher. The resulting ranked demonstrations are transformed into geometric descriptors O and used to train a reward function R(O), which in turn is used by a policy optimization algorithm to optimize policies on unknown contexts c test . For the policy optimization algorithm, we use VIPS [14,15]. To make results more stable, we optimize on a scaled rewardR(O) = α scale R(O) instead of the regular reward, where α scale is a scalar Reward Scale. We call the resulting algorithm EM+D-REX. Comparing EM+D-REX and VIGOR, both approaches train a discriminator that uses expert demonstrations on training contexts to fit novel test contexts. Similarly, both make use of VIPS to optimize marginal policies to match multi-modal distributions over geometric behavioral descriptors. However, EM+D-REX uses the discriminator to represent a reward function, while VIGOR iteratively re-trains the discriminator until convergence of the test policies.

B.2 State-Action Baselines
We also compare our approach to common state-action based imitation learning algorithms to see how well these approaches work on versatile human demonstrations. More precisely, we compare to BC [17] and Generative Adversarial Imitation Learning (GAIL) [5] as implemented in the Imitation [45] repository. The state-action baselines use velocities as actions, and receive the geometric descriptors of the current robot state plus the current time-step as state information. For the Point Reaching tasks, we also experiment with encoding which of the points has been reached to make the tasks Markovian. We use the Proximal Policy Optimization (PPO) [46] implementation of Stable Baselines3 [47] as the policy for GAIL. To accommodate for versatility on an action level, we also compare to BC-GMM [13], which trains a policy whose head outputs the parameters of a GMM over actions per state. We note that we do not make use of the Low Noise Evaluation Trick proposed in Mandlekar et al. [13], which leads to minor improvements in their experiments and does not affect our results. During evaluation, we also generate each trajectory from a fixed component rather than sampling a new component mean per step for consistency with the other approaches. Experimentally, we found no significant difference in performance between these two evaluation methods. In our experiments, both BC and BC-GMM also make use of an auxiliary entropy regularization term that is similar to Zhou et al. [18]. This prevents the covariances from collapsing. All state-action baselines use regular MLPs for their policy.

B.3 Trajectory-based Baselines
Finally, we employ BC and BC-GMM on a trajectory-based level, i.e., we imitate full trajectories instead of individual state-action pairs. These baselines are added to see how simple (multi-modal) behavioral cloning works on full expert trajectories. In this setup, the methods see as input the context of the task, e.g., the position of the target points for the point reaching tasks, and output a contextual distribution q(w|c) over ProMP parameters. This distribution is implemented as a simple MLP. To discriminate between state-action and trajectory-based baselines, we append suffixes '(S)' and '(T)' respectively. For example, we denote state-action BC as 'BC(S)' and trajectory-based Mixture-Density BC as 'BC-GMM(T)'.

C.1 Planar Reacher
Setup. Each context is specified by its target positions, which are drawn from independent isotropic Gaussians with means (0.5, 2.5) and (0.5, −2.5) and standard deviation 0.5. Both targets have a radius of r = 0.5 to be considered reached. The robot always starts with all joints at a resting position of 0 deg. We collect demonstrations via a joystick-based setup to control the end-effector's (x, y)-position and rotation. This is paired with an inverse kinematics controller to control the joints.
Success Rates. We define a demonstration as successful if it reaches both target circles and ends its trajectory in the second circle, i.e., if its target distance is 0. As such, a demonstration is considered successful if it has the same target distance as the expert demonstrations. The left of Figure 6 shows success rates on test contexts for different approaches trained on 6 training contexts. Qualitative results. To explore the versatility of solutions learned by VIGOR and EM+D-REX, we visualize exemplary policies learned by both methods in Figures 7. We find that VIGOR produces versatile policies that closely match the demonstrations of the expert, with most components finding a different solution to the given task and samples of these components generally hitting both targets. At the same time, the policies of EM+D-REX often collapse to only 1 or 2 different solutions, likely due to a lack of a clear distribution matching objective.

C.2 Panda Reacher
Setup. In the teleoperation setup, the human demonstrator moves a physical robot. The robot then sends its movement to a virtual twin. The joint values of the twin are recorded over time to generate expert demonstrations. An overview of the virtual part of this setup is given in Figure 8. We preprocess the human demonstrations by removing initial steps until the robot starts moving, and repeating the last recorded time-step before fitting the ProMPs to ensure that the fit trajectories end near the goal position. This is done to counteract a potential over-smoothing effect of the ProMPs fitting the human trajectories.
Success Rates. The right of Figure 6 shows success rates on test contexts for different approaches trained on 6 training contexts. A demonstration is considered successful if it reaches both target circles and ends its trajectory in the second circle, i.e., if its target distance is 0cm. This corresponds to the target distance of the expert demonstrations.

C.3 Box Pusher
Setup. Demonstrations are collected using a virtual setup similar to that of the Planar Reacher task. The demonstrator controls a mouse in the (x, y)-plane that the end-effector of the robot follows using inverse kinematics. The rotation of the end-effector is fixed to have it point straight down. The height of the end-effector is fixed such that the rod is slightly above the table. The trajectories, including the initial position of the end-effector, are fit in the (x, y) plane of the task-space for simplicity. To roll out a given trajectory on the robot, the (x, y) coordinates over time are concatenated with a fixed z-value and a downward rotation are given to the inverse kinematic controller. We sample the contexts from box translations and rotations that are feasible to demonstrate within a single smooth movement.
As there tends to be a high correlation between the (x, y)-displacement and the rotation angle in the resulting contexts, we make sure that the training contexts are balanced w.r.t. this correlation.
In order for the state-action baselines to be able to choose an initial position for the trajectory, we use a separate copy of the behavioral descriptors as input for the state-action at time-step 0. In other words, we have 2 inputs in the neural network for every feature. One of these is always 0 except at step 0, where it is set to the geometric descriptors. The other is always set to the geometric descriptors, except at step 0, where it is set to 0. The output of the policy for this first time-step is then interpreted as the starting position relative to the center of the box. Outputs in later steps correspond to velocities in the (x, y)-plane.
Task visualization. Figure 9 shows final states of the Box Pusher task for VIGOR for 6 test contexts on test contexts for policies trained with demonstrations from 24 training contexts. Figure 10 shows the difference between desired and executed trajectories for 3 learned GMM component means on the same test context. These differences result from the contact with the (comparably heavy) box and are compensated by our approach.
Success Rates. The left of Figure 11 shows success rates on test contexts for different approaches trained on 6 training contexts. A demonstration is considered successful if the average distance of the corners of the final box to that of the desired final position is less than 1.5cm, which roughly corresponds to the maximum error made by any expert demonstration.
Results on training contexts. Results of VIGOR trained on 6 training contexts on the Box Pusher task for training contexts can be seen on the right of Figure 11.
Online task variants. To further validate the effectiveness of our geometric descriptors, we experimented with variants of BC and BC-GMM, where the distances are computed w.r.t. the current box position. We find that this choice of descriptors leads to diverging behavior on test contexts.

Distance to Target [m]
Demonstrations Initial Box Position Figure 11: (Left) Mean success rates on test contexts for the Box Pusher task. We find that VIGOR produces the most successful demonstrations, while EM+D-REX and BC-GMM (S) are able to sometimes solve the task. Interestingly, BC-GMM (T) does not produce successful solutions even though it improves the distance to target, as seen on the left of Figure 4. We find that this corresponds to trajectories that push the box in the right general direction, but do not account for a precise combination of target positions and angle. (Right) Mean distance to target for training contexts of the box pushing task. Most methods reliably improve over the initial box position on training contexts. Interestingly, EM+D-REX benefits very little from evaluating on the training set, presumably because the direct correspondence to the training data is lost by the intermediate reward representation. VIGOR reaches human performance on this setup, suggesting that it can match the distribution of behavioral descriptors of the human demonstrations.   Figure 12: Full ablation study of VIGOR on the Planar Reacher task. VIGOR benefits from concise behavioral descriptors and is better suited to fit ProMP fits of the human demonstrations rather than the demonstrations themselves. We benefit from additional data in form of more demonstrations and more training contexts, as well as from additional components and discriminators.

D Ablations
We perform additional ablations for VIGOR and EM+D-REX on both the Planar Reacher and the Panda Reacher task. The ablations for VIGOR and EM+D-REX on the Planar Reacher task can be seen in Figures 12 and 13  Overall, we ablate the choice of geometric descriptors, trying both a concatenation of joint angles and context (Angles) as well as distances and velocity and acceleration for each robot joint (Jointwise). Additionally, we look at the performance of VIGOR when trained directly on human demonstrations that are sup-sampled to T time-steps (Raw) without first fitting a ProMP on the said demonstrations. We also evaluate the discriminator's architecture, trying out both a shared MLP per step (MLP) with an additional encoding of the time-step, and a Long Short-Term Memory (LSTM) [48]. Both architectures are configured to be of similar size to the 1d-CNN. We also evaluate the effects of different numbers of mixture components (#Components), using an ensemble of discriminators (#Discriminators), the stepwise BCE loss (Disc. Loss, c.f. Eq. 3), and the amount of training contexts (#Contexts). Finally, we inspect the number of used demonstrations per context (#Demos), and the number of 1d-CNN layers (#Layers) as well as the number of convolutional channels per layer (Layer Width).
For EM+D-REX, we also look at how the number of fit EM components influences the performance, and how the algorithm-specific hyperparameters (see Appendix B.1) need to be tuned for good performance. The ablations show that EM+D-REX performs well if tuned right, but that it is very sensitive to the choice of hyperparameters. The most important choice of hyperparameter seems to be the number of EM components compared to the number of demonstrations per training context. Depending on the task and the remaining parameters, EM+D-REX either prefers a number of components similar to the number of demonstrations, or only a single component. We assume that this sensitivity to the choice of hyperparameters comes from the setup of EM+D-REX. While VIGOR iteratively improves its policies to match the distribution of the expert demonstrations under the geometric behavioral descriptors, EM+D-REX trains a reward function once and then uses this recovered reward function for training policies on the test contexts. As a result, any mistake in the recovered reward will directly influence the way that the newly trained policies are optimized.   Figure 13: Ablation study of EM+D-REX on the Planar Reacher task. EM+D-REX performs well if tuned correctly, but is very sensitive to its choice of hyperparameters.   Figure 15: Ablation study of EM+D-REX on the Panda Reacher task. On this task, EM+D-REX often collapses to a single solution for the task, which can be seen by the proximity of all 5 components in each bar. The method is again very susceptible to the choice of hyperparameters, which need to be tuned on a by-task basis. Table 1 gives an overview of default environment parameters. Note that parameters with a '*' are varied in the ablations. For each environment, we randomly draw both training and test contexts at runtime from a fixed set of contexts, making sure that training and test contexts are disjoint for any given seed.

E.2 Algorithm Hyperparameters
All neural networks are trained in PyTorch [49] using the Adam [50] optimizer. We employ Dropout [51], early stopping and Batch Normalization [52] to avoid overfitting. All methods are trained until convergence. All mixture policies use 5 components for all experiments.
All methods use the geometric descriptors of the respective environments as input. We use a learning rate of 3.0e − 4 for all methods except EM+D-REX, for which we found a learning rate of 3.0e − 5 to be more stable. VIGOR and EM+D-REX both use the equations introduced in [16] for updating their policies. We found that the method performed very similarly for a range of tested KL-Bound hyperparameters, and thus set it to 0.2 for all experiments for simplicity. We also always draw a sufficient amount of samples to estimate a full-rank quadratic surrogate to update the parameters of their mixture models in each iteration. Both VIGOR and EM+D-REX also make use of an ensemble with 5 networks, Dropout of 0.2 and use early stopping with a validation split of 0.1. We do not train the categorical distribution for either VIGOR or EM+D-REX. We find that Batch Normalization improves performance for EM+D-REX, but not for VIGOR, and as such only use it for EM+D-REX. Table 2 lists the remaining hyperparameters by task for VIGOR, Table 3 those of EM+D-REX.
For both BC and BC-GMM we find that training for 3000 and 30000 epochs on the state-action and trajectory-based settings works best respectively. Both use an entropy regularization term with a weight of 1.0e − 3. For BC-GMM, we additionally add an option to either train or not train the categorical distribution of the mixture to our hyperparameter search. If not trained, the distribution defaults to a uniform distribution over all components, similar to that of VIGOR and EM+D-REX. Remaining hyperparameters by task for BC(S) and BC-GMM(S) are given in Tables 4  and 5 respectively. Those of BC(T) and BC-GMM(T) are given in Tables 6 and 7. Hyperparameters for GAIL are listed in Table 8.