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
3bc36fe1
Commit
3bc36fe1
authored
Jun 03, 2011
by
Davis King
Browse files
minor cleanup
parent
94067a76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/using_custom_kernels_ex.cpp
examples/using_custom_kernels_ex.cpp
+2
-2
No files found.
examples/using_custom_kernels_ex.cpp
View file @
3bc36fe1
...
...
@@ -100,7 +100,7 @@ void deserialize ( ukf_kernel<T>& item, std::istream& in )
// ----------------------------------------------------------------------------------------
/*
This next thing, the kernel_derivative specialization is
OPTIONAL
. You only need
This next thing, the kernel_derivative specialization is
optional
. You only need
to define it if you want to use the dlib::reduced2() or dlib::approximate_distance_function()
routines. If so, then you need to supply code for computing the derivative of your kernel as
shown below. Note also that you can only do this if your kernel operates on dlib::matrix
...
...
@@ -166,7 +166,7 @@ int main()
// A valid kernel must always give rise to kernel matrices which are symmetric
// and positive semidefinite (i.e. have nonnegative eigenvalues). This next
// bit of code makes a kernel matrix and checks if
this is true
.
// bit of code makes a kernel matrix and checks if
it has these properties
.
const
matrix
<
double
>
K
=
kernel_matrix
(
kernel_type
(
0.1
),
randomly_subsample
(
samples
,
500
));
cout
<<
"
\n
Is it symmetric? (this value should be 0): "
<<
min
(
abs
(
K
-
trans
(
K
)))
<<
endl
;
cout
<<
"Smallest eigenvalue (should be >= 0): "
<<
min
(
real_eigenvalues
(
K
))
<<
endl
;
...
...
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