From 04d60232ab7f665f92426e28d780fd5eed1589d5 Mon Sep 17 00:00:00 2001 From: Sergio Quijano Date: Sun, 21 Apr 2024 20:19:51 +0200 Subject: [PATCH] doc, style #70: better doc style for one of Adam's class --- src/adambielski_lib/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/adambielski_lib/utils.py b/src/adambielski_lib/utils.py index 10215ed..c28c9ce 100644 --- a/src/adambielski_lib/utils.py +++ b/src/adambielski_lib/utils.py @@ -45,10 +45,14 @@ def semihard_negative(loss_values, margin): class FunctionNegativeTripletSelector(TripletSelector): """ - For each positive pair, takes the hardest negative sample (with the greatest triplet loss value) to create a triplet + For each positive pair, takes the hardest negative sample (with the greatest + triplet loss value) to create a triplet. + Margin should match the margin used in triplet loss. - negative_selection_fn should take array of loss_values for a given anchor-positive pair and all negative samples - and return a negative index for that pair + + negative_selection_fn should take array of loss_values for a given + anchor-positive pair and all negative samples and return a negative index + for that pair. """ def __init__(self, margin, negative_selection_fn, cpu=True):