Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
89f3e775
Commit
89f3e775
authored
Feb 14, 2015
by
Davis King
Browse files
Added compile time assert checks on the type given to the kernels.
parent
1f97eedc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
dlib/svm/kernel.h
dlib/svm/kernel.h
+12
-0
No files found.
dlib/svm/kernel.h
View file @
89f3e775
...
...
@@ -29,6 +29,9 @@ namespace dlib
typedef
T
sample_type
;
typedef
typename
T
::
mem_manager_type
mem_manager_type
;
// T must be capable of representing a column vector.
COMPILE_TIME_ASSERT
(
T
::
NC
==
1
||
T
::
NC
==
0
);
radial_basis_kernel
(
const
scalar_type
g
)
:
gamma
(
g
)
{}
radial_basis_kernel
()
:
gamma
(
0.1
)
{}
radial_basis_kernel
(
...
...
@@ -133,6 +136,9 @@ namespace dlib
typedef
T
sample_type
;
typedef
typename
T
::
mem_manager_type
mem_manager_type
;
// T must be capable of representing a column vector.
COMPILE_TIME_ASSERT
(
T
::
NC
==
1
||
T
::
NC
==
0
);
polynomial_kernel
(
const
scalar_type
g
,
const
scalar_type
c
,
const
scalar_type
d
)
:
gamma
(
g
),
coef
(
c
),
degree
(
d
)
{}
polynomial_kernel
()
:
gamma
(
1
),
coef
(
0
),
degree
(
1
)
{}
polynomial_kernel
(
...
...
@@ -244,6 +250,9 @@ namespace dlib
typedef
T
sample_type
;
typedef
typename
T
::
mem_manager_type
mem_manager_type
;
// T must be capable of representing a column vector.
COMPILE_TIME_ASSERT
(
T
::
NC
==
1
||
T
::
NC
==
0
);
sigmoid_kernel
(
const
scalar_type
g
,
const
scalar_type
c
)
:
gamma
(
g
),
coef
(
c
)
{}
sigmoid_kernel
()
:
gamma
(
0.1
),
coef
(
-
1.0
)
{}
sigmoid_kernel
(
...
...
@@ -349,6 +358,9 @@ namespace dlib
typedef
T
sample_type
;
typedef
typename
T
::
mem_manager_type
mem_manager_type
;
// T must be capable of representing a column vector.
COMPILE_TIME_ASSERT
(
T
::
NC
==
1
||
T
::
NC
==
0
);
scalar_type
operator
()
(
const
sample_type
&
a
,
const
sample_type
&
b
...
...
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