Task-Driven Sparse Coding for Classification of Motion Data