Learning Robot Skills with Temporal Variational Inference