def delete_all(dbname): # TODO: replace this with an input() y/n type thing y, n = 'y', 'n' db = 'mongo://localhost:44556/%s/jobs' % dbname print 'Are you sure you want to delete ALL trials from %s?' % db if input() != y: return trials = MongoTrials(db) B = main_lfw_driver(trials) B.delete_all()
def lfw_suggest(dbname, port=44556, **kwargs): """ This class presents the entire LFW experiment as a BanditAlgo so that it can be started up with hyperopt-mongo-search --exp_key='' eccv12.lfw.MultiBandit \ eccv12.eccv12.WholeExperiment fab lfw_suggest:test_hyperopt,port=22334,random=.5,TPE=.5 """ port = int(port) if len(kwargs) > 0: priorities = {} for k in kwargs: priorities[k] = float(kwargs[k]) else: priorities = None trials = MongoTrials('mongo://localhost:%d/%s/jobs' % (port, dbname)) B = main_lfw_driver(trials) B.run(priorities=priorities)
def test_main_lfw_driver(): trials = hyperopt.Trials(exp_key='ek_base') B = exps.main_lfw_driver(trials) B.pretty_info()