  One challenge of motion generation using robot learning from demonstration
techniques is that human demonstrations follow a distribution with multiple
modes for one task query. Previous approaches fail to capture all modes or tend
to average modes of the demonstrations and thus generate invalid trajectories.
The other difficulty is the small number of demonstrations that cannot cover
the entire working space. To overcome this problem, a motion generation model
with extrapolation ability is needed. Previous works restrict task queries as
local frames and learn representations in local frames. We propose a model to
solve both problems. For multiple modes, we suggest to learn local latent
representations of motion trajectories with a density estimation method based
on real-valued non-volume preserving (RealNVP) transformations that provides a
set of powerful, stably invertible, and learnable transformations. To improve
the extrapolation ability, we propose to shift the attention of the robot from
one local frame to another during the task execution. In experiments, we
consider the docking problem used also in previous works where a trajectory has
to be generated to connect two dockers without collision. We increase
complexity of the task and show that the proposed method outperforms other
approaches. In addition, we evaluate the approach in real robot experiments.
