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
5e751337
Commit
5e751337
authored
Aug 27, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched loss counting variables from integers to doubles so they
can count real valued loss values correctly.
parent
79547b61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
cross_validate_graph_labeling_trainer.h
dlib/svm/cross_validate_graph_labeling_trainer.h
+12
-12
No files found.
dlib/svm/cross_validate_graph_labeling_trainer.h
View file @
5e751337
...
...
@@ -44,10 +44,10 @@ namespace dlib
#endif
std
::
vector
<
bool
>
temp
;
unsigned
long
num_pos_correct
=
0
;
unsigned
long
num_pos
=
0
;
unsigned
long
num_neg_correct
=
0
;
unsigned
long
num_neg
=
0
;
double
num_pos_correct
=
0
;
double
num_pos
=
0
;
double
num_neg_correct
=
0
;
double
num_neg
=
0
;
for
(
unsigned
long
i
=
0
;
i
<
samples
.
size
();
++
i
)
{
...
...
@@ -76,11 +76,11 @@ namespace dlib
matrix
<
double
,
1
,
2
>
res
;
if
(
num_pos
!=
0
)
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
)
;
res
(
0
)
=
num_pos_correct
/
num_pos
;
else
res
(
0
)
=
1
;
if
(
num_neg
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
)
;
res
(
1
)
=
num_neg_correct
/
num_neg
;
else
res
(
1
)
=
1
;
return
res
;
...
...
@@ -152,10 +152,10 @@ namespace dlib
long
next_test_idx
=
0
;
std
::
vector
<
bool
>
temp
;
unsigned
long
num_pos_correct
=
0
;
unsigned
long
num_pos
=
0
;
unsigned
long
num_neg_correct
=
0
;
unsigned
long
num_neg
=
0
;
double
num_pos_correct
=
0
;
double
num_pos
=
0
;
double
num_neg_correct
=
0
;
double
num_neg
=
0
;
graph_type
gtemp
;
...
...
@@ -224,11 +224,11 @@ namespace dlib
matrix
<
double
,
1
,
2
>
res
;
if
(
num_pos
!=
0
)
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
)
;
res
(
0
)
=
num_pos_correct
/
num_pos
;
else
res
(
0
)
=
1
;
if
(
num_neg
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
)
;
res
(
1
)
=
num_neg_correct
/
num_neg
;
else
res
(
1
)
=
1
;
return
res
;
...
...
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