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
bc9bf360
Commit
bc9bf360
authored
Aug 08, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checks into the vector_normalizer and vector_normalizer_pca objects
to detect users giving infinite and NaN values as inputs.
parent
ec4865ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
statistics.h
dlib/statistics/statistics.h
+4
-0
statistics_abstract.h
dlib/statistics/statistics_abstract.h
+2
-0
No files found.
dlib/statistics/statistics.h
View file @
bc9bf360
...
...
@@ -1148,6 +1148,8 @@ namespace dlib
m
=
mean
(
mat
(
samples
));
sd
=
reciprocal
(
sqrt
(
variance
(
mat
(
samples
))));
DLIB_ASSERT
(
is_finite
(
m
),
"Some of the input vectors to vector_normalizer::train() have infinite or NaN values"
);
}
long
in_vector_size
(
...
...
@@ -1310,6 +1312,8 @@ namespace dlib
<<
"
\n\t
this: "
<<
this
);
train_pca_impl
(
mat
(
samples
),
eps
);
DLIB_ASSERT
(
is_finite
(
m
),
"Some of the input vectors to vector_normalizer_pca::train() have infinite or NaN values"
);
}
long
in_vector_size
(
...
...
dlib/statistics/statistics_abstract.h
View file @
bc9bf360
...
...
@@ -770,6 +770,7 @@ namespace dlib
- samples == a column matrix or something convertible to a column
matrix via mat(). Also, x should contain
matrix_type objects that represent nonempty column vectors.
- samples does not contain any infinite or NaN values
ensures
- #in_vector_size() == samples(0).nr()
- #out_vector_size() == samples(0).nr()
...
...
@@ -928,6 +929,7 @@ namespace dlib
- samples == a column matrix or something convertible to a column
matrix via mat(). Also, x should contain
matrix_type objects that represent nonempty column vectors.
- samples does not contain any infinite or NaN values
ensures
- This object has learned how to normalize vectors that look like
vectors in the given set of samples.
...
...
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