Yelp / MOE

A global, black box optimization engine for real world metric optimization.
Other
1.31k stars 140 forks source link

[C++] optimizers crash if you specify num_multistarts = 0 or num_random_samples = 0 #345

Closed suntzu86 closed 10 years ago

suntzu86 commented 10 years ago

C++ optimization begins by initializing the next_point. This is typically initialized to one of the multistart points (just so that it has a valid value).

If you specify num_multistarts = 0 (or num_random_samples for dumb-search), then there is NO first point and we will read unallocated memory.

edit: note this isn't a huge deal right now b/c no actual use cases can encounter this situation.

the fix: have methods that care raise an exception if <= 0 multistarts is requested.