Soft Contrastive Learning for Visual Localization