Automatic Alignment of Local Representations