Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
e0b6e189
Commit
e0b6e189
authored
Apr 29, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just renamed some things
parent
0dd5976f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
structural_svm_graph_labeling_problem.h
dlib/svm/structural_svm_graph_labeling_problem.h
+13
-13
No files found.
dlib/svm/structural_svm_graph_labeling_problem.h
View file @
e0b6e189
// Copyright (C) 2012 Davis E. King (davis@dlib.net)
// Copyright (C) 2012 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_STRUCTURAL_SVM_
POtTS
_PROBLEM_H__
#ifndef DLIB_STRUCTURAL_SVM_
GRAPH_LAbELING
_PROBLEM_H__
#define DLIB_STRUCTURAL_SVM_
POtTS
_PROBLEM_H__
#define DLIB_STRUCTURAL_SVM_
GRAPH_LAbELING
_PROBLEM_H__
#include "structural_svm_
potts
_problem_abstract.h"
#include "structural_svm_
graph_labeling
_problem_abstract.h"
#include "../graph_cuts.h"
#include "../graph_cuts.h"
#include "../matrix.h"
#include "../matrix.h"
#include "../array.h"
#include "../array.h"
...
@@ -23,7 +23,7 @@ namespace dlib
...
@@ -23,7 +23,7 @@ namespace dlib
template
<
template
<
typename
graph_type
typename
graph_type
>
>
bool
is_
potts_learn
ing_problem
(
bool
is_
graph_label
ing_problem
(
const
dlib
::
array
<
graph_type
>&
samples
,
const
dlib
::
array
<
graph_type
>&
samples
,
const
std
::
vector
<
std
::
vector
<
node_label
>
>&
labels
const
std
::
vector
<
std
::
vector
<
node_label
>
>&
labels
)
)
...
@@ -33,15 +33,15 @@ namespace dlib
...
@@ -33,15 +33,15 @@ namespace dlib
- graph_type::type and graph_type::edge_type are either dlib::matrix types
- graph_type::type and graph_type::edge_type are either dlib::matrix types
capable of containing column vectors or some kind of sparse vector type.
capable of containing column vectors or some kind of sparse vector type.
ensures
ensures
- Note that a
potts learn
ing problem is a task to learn a binary classifier which
- Note that a
graph label
ing problem is a task to learn a binary classifier which
predicts the correct label for each node in the provided graphs. Additionally,
predicts the correct label for each node in the provided graphs. Additionally,
we have information in the form of graph edges between nodes where edges are
we have information in the form of graph edges between nodes where edges are
present when we believe the linked nodes are likely to have the same label.
present when we believe the linked nodes are likely to have the same label.
Therefore, part of a
potts learn
ing problem is to learn to score each edge in
Therefore, part of a
graph label
ing problem is to learn to score each edge in
terms of how strongly the edge should enforce labeling consistency between
terms of how strongly the edge should enforce labeling consistency between
its two nodes. Thus, to be a valid
potts
problem, samples should contain
its two nodes. Thus, to be a valid
graph labeling
problem, samples should contain
example graphs of connected nodes while labels should indicate the desired
example graphs of connected nodes while labels should indicate the desired
label of each node. The precise requirements for a valid
potts learn
ing
label of each node. The precise requirements for a valid
graph label
ing
problem are listed below.
problem are listed below.
- This function returns true if all of the following are true and false otherwise:
- This function returns true if all of the following are true and false otherwise:
- is_learning_problem(samples, labels) == true
- is_learning_problem(samples, labels) == true
...
@@ -99,7 +99,7 @@ namespace dlib
...
@@ -99,7 +99,7 @@ namespace dlib
template
<
template
<
typename
graph_type
typename
graph_type
>
>
class
structural_svm_
potts
_problem
:
noncopyable
,
class
structural_svm_
graph_labeling
_problem
:
noncopyable
,
public
structural_svm_problem_threaded
<
matrix
<
double
,
0
,
1
>
,
public
structural_svm_problem_threaded
<
matrix
<
double
,
0
,
1
>
,
typename
dlib
::
impl
::
fvect
<
graph_type
>::
type
>
typename
dlib
::
impl
::
fvect
<
graph_type
>::
type
>
{
{
...
@@ -111,7 +111,7 @@ namespace dlib
...
@@ -111,7 +111,7 @@ namespace dlib
typedef
std
::
vector
<
node_label
>
label_type
;
typedef
std
::
vector
<
node_label
>
label_type
;
structural_svm_
potts
_problem
(
structural_svm_
graph_labeling
_problem
(
const
dlib
::
array
<
sample_type
>&
samples_
,
const
dlib
::
array
<
sample_type
>&
samples_
,
const
std
::
vector
<
label_type
>&
labels_
,
const
std
::
vector
<
label_type
>&
labels_
,
unsigned
long
num_threads
=
2
unsigned
long
num_threads
=
2
...
@@ -121,8 +121,8 @@ namespace dlib
...
@@ -121,8 +121,8 @@ namespace dlib
labels
(
labels_
)
labels
(
labels_
)
{
{
// make sure requires clause is not broken
// make sure requires clause is not broken
DLIB_ASSERT
(
is_
potts_learn
ing_problem
(
samples
,
labels
)
==
true
,
DLIB_ASSERT
(
is_
graph_label
ing_problem
(
samples
,
labels
)
==
true
,
"
\t
structural_svm_
potts_problem::structural_svm_potts
_problem()"
"
\t
structural_svm_
graph_labeling_problem::structural_svm_graph_labeling
_problem()"
<<
"
\n\t
invalid inputs were given to this function"
);
<<
"
\n\t
invalid inputs were given to this function"
);
...
@@ -350,6 +350,6 @@ namespace dlib
...
@@ -350,6 +350,6 @@ namespace dlib
}
}
#endif // DLIB_STRUCTURAL_SVM_
POtTS
_PROBLEM_H__
#endif // DLIB_STRUCTURAL_SVM_
GRAPH_LAbELING
_PROBLEM_H__
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment