Skip to content

Commit

Permalink
Added utility function that can be overloaded by image scanners that …
Browse files Browse the repository at this point in the history
…want to

use nuclear norm regularization in their parameter estimation.
  • Loading branch information
davisking committed Nov 2, 2013
1 parent afcc4e7 commit fb93707
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dlib/svm/structural_object_detection_trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <
Expand Down Expand Up @@ -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<double,0,1> w;

// Run the optimizer to find the optimal w.
Expand Down

0 comments on commit fb93707

Please sign in to comment.