From fb937072fea32c8a8031ee17cc203dc19105a919 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 1 Nov 2013 20:19:50 -0400 Subject: [PATCH] Added utility function that can be overloaded by image scanners that want to use nuclear norm regularization in their parameter estimation. --- dlib/svm/structural_object_detection_trainer.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlib/svm/structural_object_detection_trainer.h b/dlib/svm/structural_object_detection_trainer.h index d72f53cb8e..37c9bac35b 100644 --- a/dlib/svm/structural_object_detection_trainer.h +++ b/dlib/svm/structural_object_detection_trainer.h @@ -15,6 +15,21 @@ namespace dlib { +// ---------------------------------------------------------------------------------------- + + template < + typename image_scanner_type, + typename svm_struct_prob_type + > + void configure_nuclear_norm_regularizer ( + const image_scanner_type&, + svm_struct_prob_type& + ) + { + // does nothing by default. Specific scanner types overload this function to do + // whatever is appropriate. + } + // ---------------------------------------------------------------------------------------- template < @@ -287,6 +302,7 @@ namespace dlib svm_prob.set_match_eps(match_eps); svm_prob.set_loss_per_missed_target(loss_per_missed_target); svm_prob.set_loss_per_false_alarm(loss_per_false_alarm); + configure_nuclear_norm_regularizer(scanner, svm_prob); matrix w; // Run the optimizer to find the optimal w.