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
bda0943d
Commit
bda0943d
authored
May 05, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed graph_labeler requirements to allow for zero sized sparse vectors.
parent
4d46517e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
graph_labeler.h
dlib/svm/graph_labeler.h
+4
-6
graph_labeler_abstract.h
dlib/svm/graph_labeler_abstract.h
+0
-2
No files found.
dlib/svm/graph_labeler.h
View file @
bda0943d
...
...
@@ -39,7 +39,7 @@ namespace dlib
node_weights
(
node_weights_
)
{
// make sure requires clause is not broken
DLIB_ASSERT
(
min
(
edge_weights
)
>=
0
,
DLIB_ASSERT
(
edge_weights
.
size
()
==
0
||
min
(
edge_weights
)
>=
0
,
"
\t
graph_labeler::graph_labeler()"
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
min(edge_weights): "
<<
min
(
edge_weights
)
...
...
@@ -61,9 +61,7 @@ namespace dlib
{
// make sure requires clause is not broken
#ifdef ENABLE_ASSERTS
DLIB_ASSERT
(
get_edge_weights
().
size
()
!=
0
&&
get_node_weights
().
size
()
!=
0
&&
graph_contains_length_one_cycle
(
sample
)
==
false
,
DLIB_ASSERT
(
graph_contains_length_one_cycle
(
sample
)
==
false
,
"
\t
void graph_labeler::operator()"
<<
"
\n\t
Invalid inputs were given to this function."
<<
"
\n\t
get_edge_weights().size(): "
<<
get_edge_weights
().
size
()
...
...
@@ -103,9 +101,9 @@ namespace dlib
);
}
DLIB_ASSERT
(
min
(
sample
.
node
(
i
).
edge
(
n
))
>=
0
,
DLIB_ASSERT
(
sample
.
node
(
i
).
edge
(
n
).
size
()
==
0
||
min
(
sample
.
node
(
i
).
edge
(
n
))
>=
0
,
"
\t
void graph_labeler::operator()"
<<
"
\n\t
Invalid inputs were given to this function
."
<<
"
\n\t
No edge vectors are allowed to have negative elements
."
<<
"
\n\t
min(sample.node(i).edge(n)): "
<<
min
(
sample
.
node
(
i
).
edge
(
n
))
<<
"
\n\t
i: "
<<
i
<<
"
\n\t
n: "
<<
n
...
...
dlib/svm/graph_labeler_abstract.h
View file @
bda0943d
...
...
@@ -102,8 +102,6 @@ namespace dlib
capable of representing column vectors or some kind of sparse vector
type as defined in dlib/svm/sparse_vector_abstract.h.
- graph_contains_length_one_cycle(sample) == false
- #get_edge_weights().size() != 0
- #get_node_weights().size() != 0
- for all valid i and j:
- min(edge(sample,i,j)) >= 0
- it must be legal to call dot(edge(sample,i,j), get_edge_weights())
...
...
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