Commit bcd9a781 authored by Davis King's avatar Davis King

Just renamed find_map_nmplp() to find_max_factor_graph_nmplp()

--HG--
rename : dlib/optimization/find_map_nmplp.h => dlib/optimization/find_max_factor_graph_nmplp.h
rename : dlib/optimization/find_map_nmplp_abstract.h => dlib/optimization/find_max_factor_graph_nmplp_abstract.h
rename : dlib/test/find_map_nmplp.cpp => dlib/test/find_max_factor_graph_nmplp.cpp
parent b9a9b599
......@@ -13,7 +13,7 @@
#include "optimization/optimization_least_squares.h"
#include "optimization/max_cost_assignment.h"
#include "optimization/max_sum_submatrix.h"
#include "optimization/find_map_nmplp.h"
#include "optimization/find_max_factor_graph_nmplp.h"
#endif // DLIB_OPTIMIZATIOn_HEADER
......
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_FIND_MAP_nMPLP_H__
#define DLIB_FIND_MAP_nMPLP_H__
#ifndef DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_H__
#define DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_H__
#include "find_map_nmplp_abstract.h"
#include "find_max_factor_graph_nmplp_abstract.h"
#include <vector>
#include <map>
#include "../matrix.h"
......@@ -17,7 +17,7 @@ namespace dlib
template <
typename map_problem
>
void find_map_nmplp (
void find_max_factor_graph_nmplp (
const map_problem& prob,
std::vector<unsigned long>& map_assignment,
unsigned long max_iter,
......@@ -26,7 +26,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_ASSERT( eps > 0,
"\t void find_map_nmplp()"
"\t void find_max_factor_graph_nmplp()"
<< "\n\t eps must be greater than zero"
<< "\n\t eps: " << eps
);
......@@ -197,5 +197,5 @@ namespace dlib
}
#endif // DLIB_FIND_MAP_nMPLP_H__
#endif // DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_H__
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_FIND_MAP_nMPLP_ABSTRACT_H__
#ifdef DLIB_FIND_MAP_nMPLP_ABSTRACT_H__
#undef DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_ABSTRACT_H__
#ifdef DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_ABSTRACT_H__
#include <vector>
......@@ -18,12 +18,12 @@ namespace dlib
This object represents a factor graph or graphical model. In
particular, this object defines the interface a MAP problem on
a factor graph must implement if it is to be solved using the
find_map_nmplp() routine defined at the bottom of this file.
find_max_factor_graph_nmplp() routine defined at the bottom of this file.
Note that there is no dlib::map_problem object. What you are
looking at here is simply the interface definition for a map problem.
You must implement your own version of this object for the problem
you wish to solve and then pass it to the find_map_nmplp() routine.
you wish to solve and then pass it to the find_max_factor_graph_nmplp() routine.
!*/
public:
......@@ -300,7 +300,7 @@ namespace dlib
template <
typename map_problem
>
void find_map_nmplp (
void find_max_factor_graph_nmplp (
const map_problem& prob,
std::vector<unsigned long>& map_assignment,
unsigned long max_iter,
......@@ -340,6 +340,6 @@ namespace dlib
}
#endif // DLIB_FIND_MAP_nMPLP_H__
#endif // DLIB_FIND_MAX_FACTOR_GRAPH_nMPLP_H__
......@@ -38,7 +38,7 @@ set (tests
empirical_kernel_map.cpp
entropy_coder.cpp
entropy_encoder_model.cpp
find_map_nmplp.cpp
find_max_factor_graph_nmplp.cpp
geometry.cpp
graph.cpp
hash.cpp
......
......@@ -15,7 +15,7 @@ namespace
using namespace dlib;
using namespace std;
logger dlog("test.find_map_nmplp");
logger dlog("test.find_max_factor_graph_nmplp");
// ----------------------------------------------------------------------------------------
......@@ -491,7 +491,7 @@ namespace
template <
typename map_problem
>
void find_map_brute_force (
void find_max_factor_graph_brute_force (
const map_problem& prob,
std::vector<unsigned long>& map_assignment
)
......@@ -530,11 +530,11 @@ namespace
print_spinner();
std::vector<unsigned long> map_assignment1, map_assignment2;
map_problem prob;
find_map_nmplp(prob, map_assignment1, 1000, 1e-8);
find_max_factor_graph_nmplp(prob, map_assignment1, 1000, 1e-8);
const double score1 = find_total_score(prob, map_assignment1);
find_map_brute_force(prob, map_assignment2);
find_max_factor_graph_brute_force(prob, map_assignment2);
const double score2 = find_total_score(prob, map_assignment2);
dlog << LINFO << "score NMPLP: " << score1;
......@@ -553,7 +553,7 @@ namespace
print_spinner();
std::vector<unsigned long> map_assignment1, map_assignment2;
map_problem prob;
find_map_nmplp(prob, map_assignment1, 10, 1e-8);
find_max_factor_graph_nmplp(prob, map_assignment1, 10, 1e-8);
const double score1 = find_total_score(prob, map_assignment1);
......@@ -576,13 +576,13 @@ namespace
// ----------------------------------------------------------------------------------------
class test_find_map_nmplp : public tester
class test_find_max_factor_graph_nmplp : public tester
{
public:
test_find_map_nmplp (
test_find_max_factor_graph_nmplp (
) :
tester ("test_find_map_nmplp",
"Runs tests on the find_map_nmplp routine.")
tester ("test_find_max_factor_graph_nmplp",
"Runs tests on the find_max_factor_graph_nmplp routine.")
{}
void perform_test (
......
......@@ -54,7 +54,7 @@ SRC += empirical_kernel_map.cpp
SRC += entropy_coder.cpp
SRC += entropy_encoder_model.cpp
SRC += geometry.cpp
SRC += find_map_nmplp.cpp
SRC += find_max_factor_graph_nmplp.cpp
SRC += graph.cpp
SRC += hash.cpp
SRC += hash_map.cpp
......
......@@ -49,7 +49,7 @@
<item>solve_trust_region_subproblem</item>
<item>max_cost_assignment</item>
<item>max_sum_submatrix</item>
<item>find_map_nmplp</item>
<item>find_max_factor_graph_nmplp</item>
</section>
<section>
......@@ -463,9 +463,9 @@ subject to the following constraint:
<!-- ************************************************************************* -->
<component>
<name>find_map_nmplp</name>
<name>find_max_factor_graph_nmplp</name>
<file>dlib/optimization.h</file>
<spec_file link="true">dlib/optimization/find_map_nmplp_abstract.h</spec_file>
<spec_file link="true">dlib/optimization/find_max_factor_graph_nmplp_abstract.h</spec_file>
<description>
This function is a tool for approximately solving the MAP problem in a graphical
model or factor graph with pairwise potential functions. That is, it attempts
......
......@@ -57,7 +57,7 @@
<term file="optimization.html" name="solve_least_squares_lm"/>
<term file="optimization.html" name="find_min_trust_region"/>
<term file="optimization.html" name="find_max_trust_region"/>
<term file="optimization.html" name="find_map_nmplp"/>
<term file="optimization.html" name="find_max_factor_graph_nmplp"/>
<term file="optimization.html" name="solve_trust_region_subproblem"/>
<term file="optimization.html" name="find_min_single_variable"/>
<term file="optimization.html" name="find_min_using_approximate_derivatives"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment