Unsupervised learning of prototypes and attribute weights