New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A proposal of SobolSampler
#1797
Comments
Thanks for the interesting proposal! Implementing the One concern is that the |
Thank you for your interest! At the moment, Though I am not an expert of the Sobol sequence, I believe that Dynamic search space should be out of the scope for now because the Sobol sequence is designed to fill the unit hypercube uniformly (or with low discrepancy). Use of dynamic search space immediately means that the user is not sampling from a hypercube so the sampler might not be as efficient as one might expect even if we support dynamic search space with some ad-hoc methods. I have heard of researches on low-discrepancy sequences on the various space (e.g. a sphere surface) but they look too complicated. |
This issue has not seen any recent activity. |
Another proposal; using a randomized Sobol sequence in the CMA-ES seems promising. Sobol sequence can be used to sample from a multivariate normal distribution. Any opinion/comment on this? |
This result seems to be promising. |
I agree that we need benchmark results to see if using sobol with CMA-ES works well in a realistic setting. At the moment, I am optimistic about it because the |
This issue has not seen any recent activity. |
Thank you for your proposal.
I found that your current implementation includes a sobol sequence generator copied from http://people.sc.fsu.edu/~jburkardt/py_src/sobol/sobol.html instead of using IMO, the copied files increase the maintenance cost of the code in terms of both the bug fix and code license. How about providing the |
This issue has not seen any recent activity. |
@toshihikoyanase Thanks for the proposal. I agree with your opinion, that is, the @kstoneriv3 Do you have any concerns? I would be very happy to have your contribution. |
@HideakiImamura @toshihikoyanase Thank you for the comments and sorry for the late reply. I just missed the former comment. I agree with providing the Sobol sampler as an integration module. Since it might take some time before I implement it, in case you need it soon, please feel free to implement it on your side. I am aiming to implement it by the end of this year. |
I have a question on parallelized optimization. In parallel optimization settings, every Sobol sampler in each process must share the same random seed. What do you believe is the best way to share the random seed of the Sobol sampler? At the moment, I am thinking of using |
This issue has not seen any recent activity. |
FYI, there will be soon QMC in scipy with Sobol'. scipy/scipy#10844 |
That is great news! Using scipy implementation sounds like a more reasonable option. Thank you for letting me know! |
The scipy PR has been ready for a long time, not quite sure what the holdup is to get this merged in. It could be helpful if people who would like to use it were to comment on the issue to give it some sense of urgency... |
This issue has not seen any recent activity. |
The |
Let me know if you need help. I can take some time to propose a PR. |
That is great news!! I will implement Sobol sampler for Optuna soon using |
This issue has not seen any recent activity. |
This issue was closed automatically because it had not seen any recent activity. If you want to discuss it, you can reopen it freely. |
@kstoneriv3 , would it be possible to share your repo? I am getting a 'Page not found' for the link to your repository.. In particular I want to see how you benchmarked it using kurobako |
@imbalu007 the path changed since now it's using the SciPy version, cf the open PR #2423 still waiting for reviews... Here is the correct path https://github.com/kstoneriv3/optuna/blob/feature/qmc-sampler/optuna/samplers/_qmc.py |
@kstoneriv3, @tupui, is there a plan to support priors on search space parameters? Ex: {'hyperparam1': uniform(0,1), 'hyperparam2': normal(0,1)} |
@imbalu007 I do not think it is possible in the current framework of optuna as it only supports the following 5 distributions. When you use
|
@kstoneriv3 , is there any limitation to use SciPy's distributions (https://docs.scipy.org/doc/scipy/reference/stats.html#statistical-functions-scipy-stats) and then call ppf() to calculate inverse CDF with your sobol sample? |
@imbalu007 you should ping members of the optuna team with your questions, or open a new issue since this one is closed and might not get traction. For SciPy, you can use the inverse CDF or use |
In theory, it is possible to do so. However, all of Optuna's samplers do not handle unbounded distributions such as normal distribution at the moment, and supporting such distribution in its existing API will require a significant amount of work. So I would assume that the normal prior of parameters is unlikely to be supported in the very near future. |
Motivation
The use of quasi-random low-discrepancy sequences in place of random sampling is known to perform better [1]. Sobol sequence is one of such sequences and is reported to perform well in [1].
Description
I implemented
SobolSampler
for optuna using a packagesobol_seq
, which is 1) lightweight and 2) distributed under MIT license. My implementation can be checked at my repository.Benchmark
I compared by my implementation of
SobolSampler
with existing samplers of Optuna using kurobako. From 100 benchmarks per each sampler and each dataset,SobolSampler
was reported (statistically significantly) better thanRandomSampler
for all datasets.TODOs (updated)
References
[1] Random Search for Hyper-Parameter Optimization
The text was updated successfully, but these errors were encountered: