def test_preproc_space(): rectangles_eval_fn = partial(eval_fn, protocol_cls=RectanglesVectorXV) fmin_pass_expr_memo_ctrl(rectangles_eval_fn) trials = hyperopt.Trials() space = nips2011_dbn.preproc_space() hyperopt.fmin( rectangles_eval_fn, space=space, max_evals=10, algo=hyperopt.rand.suggest, trials=trials, )
def main_convex(filename='iptrials_convex_dbn.pkl'): from skdata.larochelle_etal_2007.view import ConvexVectorXV as Protocol iptrials = get_iptrials(filename) dataset_eval_fn = partial(eval_fn, protocol_cls=Protocol) for max_evals in range(10, 50, 10): iptrials.fmin( fn=dataset_eval_fn, space=preproc_space(), algo=tpe.suggest, max_evals=max_evals, verbose=1, pass_expr_memo_ctrl=True, ) iptrials.wait() iptrials.refresh() ofile = open(filename, 'w') cPickle.dump(iptrials, ofile) ofile.close()
def main_MRBI(filename='iptrials_MRBI_dbn.pkl'): from skdata.larochelle_etal_2007.view \ import MNIST_RotatedBackgroundImages_VectorXV as Protocol iptrials = get_iptrials(filename) dataset_eval_fn = partial(eval_fn, protocol_cls=Protocol) for max_evals in range(20, 100, 200): iptrials.fmin( fn=dataset_eval_fn, space=preproc_space(), algo=tpe.suggest, max_evals=max_evals, verbose=1, pass_expr_memo_ctrl=True, ) iptrials.wait() iptrials.refresh() ofile = open(filename, 'w') cPickle.dump(iptrials, ofile) ofile.close()
def main_rectangles(filename='iptrials_rectangles_dbn.pkl'): from skdata.larochelle_etal_2007.view import RectanglesVectorXV iptrials = get_iptrials(filename) rectangles_eval_fn = partial(eval_fn, protocol_cls=RectanglesVectorXV) for max_evals in [10, 25, 50]: iptrials.fmin( fn=rectangles_eval_fn, space=preproc_space(), algo=tpe.suggest, max_evals=max_evals, verbose=1, pass_expr_memo_ctrl=True, ) iptrials.wait() iptrials.refresh() ofile = open(filename, 'w') cPickle.dump(iptrials, ofile) ofile.close()
def main_convex(filename="iptrials_convex_dbn.pkl"): from skdata.larochelle_etal_2007.view import ConvexVectorXV as Protocol iptrials = get_iptrials(filename) dataset_eval_fn = partial(eval_fn, protocol_cls=Protocol) for max_evals in range(10, 50, 10): iptrials.fmin( fn=dataset_eval_fn, space=preproc_space(), algo=tpe.suggest, max_evals=max_evals, verbose=1, pass_expr_memo_ctrl=True, ) iptrials.wait() iptrials.refresh() ofile = open(filename, "w") cPickle.dump(iptrials, ofile) ofile.close()
def main_rectangles(filename="iptrials_rectangles_dbn.pkl"): from skdata.larochelle_etal_2007.view import RectanglesVectorXV iptrials = get_iptrials(filename) rectangles_eval_fn = partial(eval_fn, protocol_cls=RectanglesVectorXV) for max_evals in [10, 25, 50]: iptrials.fmin( fn=rectangles_eval_fn, space=preproc_space(), algo=tpe.suggest, max_evals=max_evals, verbose=1, pass_expr_memo_ctrl=True, ) iptrials.wait() iptrials.refresh() ofile = open(filename, "w") cPickle.dump(iptrials, ofile) ofile.close()
""" To see the relationship between hyperparameters in the nips2011_dbn space: python nips2011_dbn_show_svg.py && dot -Tpng dbn.dot > dbn.png && eog dbn.png """ from hpnnet.nips2011_dbn import preproc_space from hyperopt.graphviz import dot_hyperparameters open("dbn.dot", "wb").write(dot_hyperparameters(preproc_space()))
""" To see the relationship between hyperparameters in the nips2011_dbn space: python nips2011_dbn_show_svg.py && dot -Tpng dbn.dot > dbn.png && eog dbn.png """ from hpnnet.nips2011_dbn import preproc_space from hyperopt.graphviz import dot_hyperparameters open('dbn.dot', 'wb').write(dot_hyperparameters(preproc_space()))