Learning with Siamese networks