Renamed the lambda variable since it clashes with a python keyword.

This commit is contained in:
Davis King 2015-03-25 17:45:12 -04:00
parent a16515eac7
commit 2e2a14879b
2 changed files with 10 additions and 10 deletions

View File

@ -198,8 +198,8 @@ void bind_shape_predictors()
.add_property("feature_pool_size", &type::feature_pool_size,
&type::feature_pool_size,
"Number of pixels used to generate features for the random trees.")
.add_property("lambda", &type::lambda,
&type::lambda,
.add_property("lambda_param", &type::lambda_param,
&type::lambda_param,
"Controls how tight the feature sampling should be. Lower values enforce closer features.")
.add_property("num_test_splits", &type::num_test_splits,
&type::num_test_splits,
@ -238,7 +238,7 @@ ensures \n\
def("train_shape_predictor", train_shape_predictor_on_images_py,
(arg("images"), arg("object_detections"), arg("options")),
"requires \n\
- options.lambda > 0 \n\
- options.lambda_param > 0 \n\
- 0 < options.nu <= 1 \n\
- options.feature_pool_region_padding >= 0 \n\
- len(images) == len(object_detections) \n\
@ -253,7 +253,7 @@ ensures \n\
def("train_shape_predictor", train_shape_predictor,
(arg("dataset_filename"), arg("predictor_output_filename"), arg("options")),
"requires \n\
- options.lambda > 0 \n\
- options.lambda_param > 0 \n\
- 0 < options.nu <= 1 \n\
- options.feature_pool_region_padding >= 0 \n\
ensures \n\

View File

@ -26,7 +26,7 @@ namespace dlib
nu = 0.1;
oversampling_amount = 20;
feature_pool_size = 400;
lambda = 0.1;
lambda_param = 0.1;
num_test_splits = 20;
feature_pool_region_padding = 0;
random_seed = "";
@ -39,7 +39,7 @@ namespace dlib
double nu;
unsigned long oversampling_amount;
unsigned long feature_pool_size;
double lambda;
double lambda_param;
unsigned long num_test_splits;
double feature_pool_region_padding;
std::string random_seed;
@ -71,8 +71,8 @@ namespace dlib
const shape_predictor_training_options& options
)
{
if (options.lambda <= 0)
throw error("Invalid lambda value given to train_shape_predictor(), lambda must be > 0.");
if (options.lambda_param <= 0)
throw error("Invalid lambda_param value given to train_shape_predictor(), lambda_param must be > 0.");
if (!(0 < options.nu && options.nu <= 1))
throw error("Invalid nu value given to train_shape_predictor(). It is required that 0 < nu <= 1.");
if (options.feature_pool_region_padding < 0)
@ -94,7 +94,7 @@ namespace dlib
trainer.set_oversampling_amount(options.oversampling_amount);
trainer.set_feature_pool_size(options.feature_pool_size);
trainer.set_feature_pool_region_padding(options.feature_pool_region_padding);
trainer.set_lambda(options.lambda);
trainer.set_lambda(options.lambda_param);
trainer.set_num_test_splits(options.num_test_splits);
if (options.be_verbose)
@ -107,7 +107,7 @@ namespace dlib
std::cout << "Training with oversampling amount: " << options.oversampling_amount << std::endl;
std::cout << "Training with feature pool size: " << options.feature_pool_size << std::endl;
std::cout << "Training with feature pool region padding: " << options.feature_pool_region_padding << std::endl;
std::cout << "Training with lambda: " << options.lambda << std::endl;
std::cout << "Training with lambda_param: " << options.lambda_param << std::endl;
std::cout << "Training with " << options.num_test_splits << " split tests."<< std::endl;
trainer.be_verbose();
}