Automatic Face Naming by Learning Discriminative Affinity Matrices From Weakly Labeled Images