Skip to content

Commit

Permalink
doc, style #70: better doc style for one of Adam's class
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioQuijanoRey committed Apr 21, 2024
1 parent 34b4ad9 commit 04d6023
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/adambielski_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 04d6023

Please sign in to comment.