From 2e2a14879be4fb3edc6f12b6fcd40820c44fe675 Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 25 Mar 2015 17:45:12 -0400 Subject: [PATCH] Renamed the lambda variable since it clashes with a python keyword. --- tools/python/src/shape_predictor.cpp | 8 ++++---- tools/python/src/shape_predictor.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/python/src/shape_predictor.cpp b/tools/python/src/shape_predictor.cpp index 98721b7e8..ee11b2125 100644 --- a/tools/python/src/shape_predictor.cpp +++ b/tools/python/src/shape_predictor.cpp @@ -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\ diff --git a/tools/python/src/shape_predictor.h b/tools/python/src/shape_predictor.h index 62b7b23f9..e0f9536db 100644 --- a/tools/python/src/shape_predictor.h +++ b/tools/python/src/shape_predictor.h @@ -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(); }