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
f467236c
Commit
f467236c
authored
Oct 17, 2017
by
jpblackburn
Committed by
Davis E. King
Oct 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow cross_validate_trainer_threaded to use non-double data (#883)
parent
2b9b3fef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
svm_threaded.h
dlib/svm/svm_threaded.h
+7
-8
svm_threaded_abstract.h
dlib/svm/svm_threaded_abstract.h
+1
-1
No files found.
dlib/svm/svm_threaded.h
View file @
f467236c
...
...
@@ -47,12 +47,12 @@ namespace dlib
{
template
<
typename
trainer_type
,
typename
m
atrix
_type
,
typename
m
em_manager
_type
,
typename
in_sample_vector_type
>
void
operator
()(
job
<
trainer_type
,
in_sample_vector_type
>&
j
,
matrix
_type
&
result
matrix
<
double
,
1
,
2
,
mem_manager_type
>
&
result
)
{
try
...
...
@@ -83,7 +83,7 @@ namespace dlib
typename
in_sample_vector_type
,
typename
in_scalar_vector_type
>
const
matrix
<
typename
trainer_type
::
scalar_typ
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
const
matrix
<
doubl
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
cross_validate_trainer_threaded_impl
(
const
trainer_type
&
trainer
,
const
in_sample_vector_type
&
x
,
...
...
@@ -93,7 +93,6 @@ namespace dlib
)
{
using
namespace
dlib
::
cvtti_helpers
;
typedef
typename
trainer_type
::
scalar_type
scalar_type
;
typedef
typename
trainer_type
::
mem_manager_type
mem_manager_type
;
// make sure requires clause is not broken
...
...
@@ -137,7 +136,7 @@ namespace dlib
std
::
vector
<
future
<
job
<
trainer_type
,
in_sample_vector_type
>
>
>
jobs
(
folds
);
std
::
vector
<
future
<
matrix
<
scalar_typ
e
,
1
,
2
,
mem_manager_type
>
>
>
results
(
folds
);
std
::
vector
<
future
<
matrix
<
doubl
e
,
1
,
2
,
mem_manager_type
>
>
>
results
(
folds
);
for
(
long
i
=
0
;
i
<
folds
;
++
i
)
...
...
@@ -212,7 +211,7 @@ namespace dlib
}
// for (long i = 0; i < folds; ++i)
matrix
<
scalar_typ
e
,
1
,
2
,
mem_manager_type
>
res
;
matrix
<
doubl
e
,
1
,
2
,
mem_manager_type
>
res
;
set_all_elements
(
res
,
0
);
// now compute the total results
...
...
@@ -221,7 +220,7 @@ namespace dlib
res
+=
results
[
i
].
get
();
}
return
res
/
(
scalar_typ
e
)
folds
;
return
res
/
(
doubl
e
)
folds
;
}
template
<
...
...
@@ -229,7 +228,7 @@ namespace dlib
typename
in_sample_vector_type
,
typename
in_scalar_vector_type
>
const
matrix
<
typename
trainer_type
::
scalar_typ
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
const
matrix
<
doubl
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
cross_validate_trainer_threaded
(
const
trainer_type
&
trainer
,
const
in_sample_vector_type
&
x
,
...
...
dlib/svm/svm_threaded_abstract.h
View file @
f467236c
...
...
@@ -17,7 +17,7 @@ namespace dlib
typename
in_sample_vector_type
,
typename
in_scalar_vector_type
>
const
matrix
<
typename
trainer_type
::
scalar_typ
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
const
matrix
<
doubl
e
,
1
,
2
,
typename
trainer_type
::
mem_manager_type
>
cross_validate_trainer_threaded
(
const
trainer_type
&
trainer
,
const
in_sample_vector_type
&
x
,
...
...
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