hyperopt / hyperopt

Distributed Asynchronous Hyperparameter Optimization in Python

Home Page:http://hyperopt.github.io/hyperopt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How many rounds of `fn` runs , by given `max_evals`?

pangjac opened this issue · comments

Hi Gurus,

I saw example from Wiki below

from hyperopt import fmin, tpe, hp
best = fmin(fn=lambda x: x ** 2,
    space=hp.uniform('x', -10, 10),
    algo=tpe.suggest,
    max_evals=1)
print best

I guess the logic behind should be something like :
init func_counter = 0
x get a value from space distribution and fn thus calculated. Now since function_counter = 0 < max_evals , we do tuning.
now the func_counter = 1, which means we have tuned once.
My question is, how many times the fn runs ? Now func_counter = 1 == max_evals, do fn got calculated one more time, or the whole fmin returns ?

I have not found the logic, so open an issue here. Apologize if I miss important guide in Wiki. Thank you!

max_evals is the maximum number of times your objective function will be evaluated. It is possible it will be evaluated less than that if Hyperopt is able to try all possible values within the defined parameter space. For example, if you are optimizing only one hyperparameter with three possible values, but max_evals is 10, there will may be fewer evaluations than the maximum.

Feel free to reopen if you have further questions.