Commit eb08cfc6 authored by Davis King's avatar Davis King

Added some comments about vector calculus.

parent 51476c4c
...@@ -1012,6 +1012,11 @@ namespace dlib ...@@ -1012,6 +1012,11 @@ namespace dlib
else else
d2 = std::sqrt(d2); d2 = std::sqrt(d2);
// It should be noted that the derivative of length(x-y) with respect
// to the x vector is the unit vector (x-y)/length(x-y). If you stare
// at the code below long enough you will see that it's just an
// application of this formula.
if (x_label == y_label) if (x_label == y_label)
{ {
// Things with the same label should have distances < dist_thresh between // Things with the same label should have distances < dist_thresh between
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment