Joint Representation Learning and Clustering via Gradient-Based Manifold Optimization