Triplet-Loss Metric Learning
Triplet-loss metric learning trains a neural network to place rows of the same class close together and rows of different classes farther apart. For each anchor row it compares the distance to a row of the same class with the distance to a row of another class and penalises cases where the second is not larger by at least a margin. Informative triplets are chosen within each training batch.
삼중항 손실 거리 학습은 같은 범주의 행은 서로 가깝게, 다른 범주의 행은 더 멀게 놓이도록 신경망을 학습합니다. 기준 행마다 같은 범주 행까지의 거리와 다른 범주 행까지의 거리를 비교해, 뒤의 거리가 여유값만큼 더 크지 않으면 벌점을 줍니다. 학습 배치마다 정보가 많은 삼중항을 골라 씁니다.
Can I learn a distance between rows under which rows of the same class are nearer to each other than to rows of other classes?
같은 범주의 행끼리가 다른 범주의 행보다 더 가깝게 되는 행 사이 거리를 학습할 수 있습니까?
The method reports the triplet loss before and after training, held-out k-nearest-neighbour accuracy in the learned space and on the raw features, the share of random test triplets ordered correctly in both spaces, and a check that the embedding has not collapsed.
When to use Triplet-Loss Metric Learning
- You need a similarity measure for retrieval, matching or nearest-neighbour classification.
- Class membership depends on non-linear combinations of features.
When to use something else
- A linear map of the features is enough: use Neighbourhood Components Analysis
- Only pairs labelled same or different are available: use Siamese Network Similarity Learning
Assumptions and requirements
- Numeric or dummy-coded features (standardised with training statistics)
- At least four rows per class
- Class labels define the similarity you want
What the analysis reports
- Triplet loss before and after training
- Held-out k-NN accuracy in the embedding and on raw features
- Share of test triplets ordered correctly
How to report it
Triplet-loss metric learning (semi-hard mining, margin 0.2) gave a held-out 5-nearest-neighbour accuracy of [value] against [value] on raw features.
Related methods
- Neighbourhood Components Analysis
- Large Margin Nearest Neighbour Metric Learning (LMNN)
- Siamese Network Similarity Learning
- K-Nearest Neighbors (KNN)
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-10.
독립 계산. 직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-10).
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Triplet-Loss Metric Learning on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable and predictor (feature) columns
- Price
- 900 credits for one analysis up to 10,000 rows (complexity level 5); larger or wider data costs more. Optional methodologist review: 3600 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.