Evaluate ResidualBlocks without LossFunction if needed.

1. Add the ability to evaluate the problem without loss function.
2. Remove static Evaluator::Evaluate
3. Refactor the common code from problem_test.cc and
   evaluator_test.cc into evaluator_test_utils.cc

Change-Id: I1aa841580afe91d288fbb65288b0ffdd1e43e827
This commit is contained in:
Sameer Agarwal
2013-02-26 09:15:39 -08:00
committed by Gerrit Code Review
parent c3fd3b960e
commit 039ff07dd1
17 changed files with 234 additions and 485 deletions
+11 -1
View File
@@ -331,7 +331,8 @@ class Problem {
// Options struct to control Problem::Evaluate.
struct EvaluateOptions {
EvaluateOptions()
: num_threads(1) {
: apply_loss_function(true),
num_threads(1) {
}
// The set of parameter blocks for which evaluation should be
@@ -360,6 +361,15 @@ class Problem {
// they were added to the problem. But, this may change if the
// user removes any residual blocks from the problem.
vector<ResidualBlockId> residual_blocks;
// Even though the residual blocks in the problem may contain loss
// functions, setting apply_loss_function to false will turn off
// the application of the loss function to the output of the cost
// function. This is of use for example if the user wishes to
// analyse the solution quality by studying the distribution of
// residuals before and after the solve.
bool apply_loss_function;
int num_threads;
};