HIPS / Spearmint

Spearmint Bayesian optimization codebase
Other
1.55k stars 329 forks source link

add documentation, some code cleanup, and a bug fix #7

Closed js850 closed 10 years ago

js850 commented 10 years ago

After seeing Jasper Snoek talk in cambridge I was inspired to try this bayesian optimization package. It seems well written and well commented, but without much documentation. I had a some difficulty trying to understand what all the variables meant and what all the routines were doing. So while I was going through the code in detail I added some documentation for my own benefit. Maybe you guys will appreciate it. But please go over my documentation carefully. The only thing worse then no documentation is incorrect documentation.

I also made some other changes.

  1. I did a bit of code cleanup, like removing tabs, removing unused imports, changing 2-space indents to 4-space, shortening long lines, etc.
  2. I added a new example for noisy functions. This is simply the branin function with some added noise.
  3. I added a file make_plots.py to the simple branin example. Using your README I was able to easily run the example, but I had no idea what to do then. I didn't know how to access the data or make predictions or find the best guess for the minimum, or show uncertainties. make_plots.py is basically my solution to that, though it may be a bit hacky. You may want to update it if there are more elegant ways of doing this. I wrote it in a general way so it can be called from any experiment directory with a 2-dimensional function (e.g. examples/noisy)
  4. I restructured main.py, separating out the part that reads in the options. I did this mostly because I wanted to re-use it for make_plots.py
  5. I renamed some variables because I found it really hard to know if variable tasks referred to a list of Task objects or a list of task names (strings). This confused me a lot and I only changed a few of the examples.

Finally, thanks for the great code

js850 commented 10 years ago

Oh, I forgot to mention that the very minor bug was in DefaultChooser where grid_size and grid_seed were not being used.

JasperSnoek commented 10 years ago

Thanks Jacob! Yes, this repo is in dire need of better documentation. Thanks for doing this! I'll review this as soon as I can (along with @mgelbart and @kswersky).

In the meantime, in order to pull this in we'd need you to agree to the contributor license agreement. If you agree could you indicate that you do in this thread?

js850 commented 10 years ago

I agree to the contributor license agreement.

mgelbart commented 10 years ago

I will review your changes soon and get back to you. Thanks for contributing all this useful documentation!