mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
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:
committed by
Gerrit Code Review
parent
c3fd3b960e
commit
039ff07dd1
+11
-1
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user