End-to-end Differentiable Clustering with Associative Memories