Simultaneous clustering and representation learning