ARM-software / mango

Parallel Hyperparameter Tuning in Python
Apache License 2.0
335 stars 40 forks source link

Multivariate distribution support and input scaling option #117

Closed tihom closed 1 month ago

tihom commented 1 month ago

closes #114 and #115

carusyte commented 1 month ago

Thank you so much for consolidating the FRs and providing a holistic, long-term solution!

I pulled the branch and tested in my setting, wondering if the tuner.py need a tweak as well:

   results = tuner.minimize()
             ^^^^^^^^^^^^^^^^
 File "/....../git/mango/mango/tuner.py", line 126, in minimize
   return self.run()
          ^^^^^^^^^^
 File "/....../git/mango/mango/tuner.py", line 113, in run
   self.results = self.runBayesianOptimizer()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/....../git/mango/mango/tuner.py", line 244, in runBayesianOptimizer
   x_failed = [x for x in X_next_PS if x not in X_next_list]
                                       ^^^^^^^^^^^^^^^^^^^^
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
mohit-bn commented 1 month ago

Thank you so much for consolidating the FRs and providing a holistic, long-term solution!

I have a test for the tuner with multi-var that works. So not sure where this error is coming from. Could you share all the inputs to the tuner (or a simpler version that still fails) so that I can reproduce it on my end.

carusyte commented 1 month ago

Thank you so much for consolidating the FRs and providing a holistic, long-term solution!

I have a test for the tuner with multi-var that works. So not sure where this error is coming from. Could you share all the inputs to the tuner (or a simpler version that still fails) so that I can reproduce it on my end.

I suspect this is due to parallel objective function and error handling? Here's the minimum example to reproduce the error: https://github.com/carusyte/mango/blob/custom-sampler/examples/multivar.ipynb

tihom commented 1 month ago

Thank you so much for consolidating the FRs and providing a holistic, long-term solution!

I have a test for the tuner with multi-var that works. So not sure where this error is coming from. Could you share all the inputs to the tuner (or a simpler version that still fails) so that I can reproduce it on my end.

I suspect this is due to parallel objective function and error handling? Here's the minimum example to reproduce the error: https://github.com/carusyte/mango/blob/custom-sampler/examples/multivar.ipynb

thanks this is great example to work through. With my setup this notebook goes through without any errors and I tried running it many times. Can you share the python and numpy version so that I can try with the same.

carusyte commented 1 month ago

Python version: 3.12.2 (main, Mar 10 2024, 17:55:21) [Clang 12.0.5 (clang-1205.0.22.9)] NumPy version: 1.26.4

Thank you so much for consolidating the FRs and providing a holistic, long-term solution!

I have a test for the tuner with multi-var that works. So not sure where this error is coming from. Could you share all the inputs to the tuner (or a simpler version that still fails) so that I can reproduce it on my end.

I suspect this is due to parallel objective function and error handling? Here's the minimum example to reproduce the error: https://github.com/carusyte/mango/blob/custom-sampler/examples/multivar.ipynb

thanks this is great example to work through. With my setup this notebook goes through without any errors and I tried running it many times. Can you share the python and numpy version so that I can try with the same.

tihom commented 1 month ago

@carusyte I was able to reproduce the issue and pushed a fix. please try on your end.

carusyte commented 1 month ago

@tihom confirmed that it can run successfully on my end. Thank you!