Contrastive Learning, with Application to Forensic Identification of Source