Similarity learning for wells based on logging data