davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.19k stars 3.34k forks source link

[question] NaN check for optimization algorithms? #1607

Open Red-Portal opened 5 years ago

Red-Portal commented 5 years ago

I found out after painful debugging that dlib's find_global_min fails with a segmentation fault when the observed values contain NaN. What do you think about including a NaN checking procedure to optimization algorithms? If you like the idea I'll work on it and commit to dlib.

davisking commented 5 years ago

It certainly shouldn't segfault. So yeah, if you want to submit a PR that makes it throw dlib::error or puts a DLIB_CASSERT on this then that would be a good addition.