Periodic Nonlinear Principal Component Neural Networks for Humanoid Motion Segmentation, Generalization, and Generation