affinity propagation coding