Spaces:
Sleeping
Sleeping
remove margin from _info
Browse files- triplet_margin_loss.py +5 -6
triplet_margin_loss.py
CHANGED
@@ -38,7 +38,7 @@ Returns:
|
|
38 |
triplet_margin_loss (`float`): Total loss.
|
39 |
Examples:
|
40 |
Example 1-A simple example
|
41 |
-
>>> triplet_margin_loss = evaluate.load("triplet_margin_loss")
|
42 |
>>> results = triplet_margin_loss.compute(
|
43 |
anchor=[-0.4765, 1.7133, 1.3971, -1.0121, 0.0732],
|
44 |
positive=[0.9218, 0.6305, 0.3381, 0.1412, 0.2607],
|
@@ -46,7 +46,7 @@ Examples:
|
|
46 |
>>> print(results)
|
47 |
{'triplet_margin_loss': 1.59}
|
48 |
Example 2-The same as Example 1, except with `margin` set to `2.0`.
|
49 |
-
>>> triplet_margin_loss = evaluate.load("triplet_margin_loss")
|
50 |
>>> results = triplet_margin_loss.compute(
|
51 |
anchor=[-0.4765, 1.7133, 1.3971, -1.0121, 0.0732],
|
52 |
positive=[0.9218, 0.6305, 0.3381, 0.1412, 0.2607],
|
@@ -88,10 +88,9 @@ class TripletMarginLoss(evaluate.EvaluationModule):
|
|
88 |
inputs_description=_KWARGS_DESCRIPTION,
|
89 |
features=datasets.Features(
|
90 |
{
|
91 |
-
"anchor": datasets.Sequence(datasets.Value("float")
|
92 |
-
"positive": datasets.Sequence(datasets.Value("float")
|
93 |
-
"negative": datasets.Sequence(datasets.Value("float")
|
94 |
-
"margin": datasets.Value("float")
|
95 |
}
|
96 |
),
|
97 |
reference_urls=["https://proceedings.neurips.cc/paper/2003/hash/d3b1fb02964aa64e257f9f26a31f72cf-Abstract.html"],
|
|
|
38 |
triplet_margin_loss (`float`): Total loss.
|
39 |
Examples:
|
40 |
Example 1-A simple example
|
41 |
+
>>> triplet_margin_loss = evaluate.load("theAIguy/triplet_margin_loss")
|
42 |
>>> results = triplet_margin_loss.compute(
|
43 |
anchor=[-0.4765, 1.7133, 1.3971, -1.0121, 0.0732],
|
44 |
positive=[0.9218, 0.6305, 0.3381, 0.1412, 0.2607],
|
|
|
46 |
>>> print(results)
|
47 |
{'triplet_margin_loss': 1.59}
|
48 |
Example 2-The same as Example 1, except with `margin` set to `2.0`.
|
49 |
+
>>> triplet_margin_loss = evaluate.load("theAIguy/triplet_margin_loss")
|
50 |
>>> results = triplet_margin_loss.compute(
|
51 |
anchor=[-0.4765, 1.7133, 1.3971, -1.0121, 0.0732],
|
52 |
positive=[0.9218, 0.6305, 0.3381, 0.1412, 0.2607],
|
|
|
88 |
inputs_description=_KWARGS_DESCRIPTION,
|
89 |
features=datasets.Features(
|
90 |
{
|
91 |
+
"anchor": datasets.Sequence(datasets.Value("float")),
|
92 |
+
"positive": datasets.Sequence(datasets.Value("float")),
|
93 |
+
"negative": datasets.Sequence(datasets.Value("float"))
|
|
|
94 |
}
|
95 |
),
|
96 |
reference_urls=["https://proceedings.neurips.cc/paper/2003/hash/d3b1fb02964aa64e257f9f26a31f72cf-Abstract.html"],
|