def tpe_to_spearmint_helper(space, save=""): try: import hyperopt except ImportError: print "Cannot find hyperopt. To use this converter, modify $PYTHONPATH to contain a hyperopt installation" # First convert to smac tmp = tpe_to_smac.convert_tpe_to_smac_from_file(space) handle, tmp_file_name = tempfile.mkstemp() fh = open(tmp_file_name, 'w') fh.write(tmp) fh.close() # From smac convert to spearmint new_space = smac_to_spearmint.convert_smac_to_spearmint(tmp_file_name) os.remove(tmp_file_name) return new_space
def tpe_to_smac_helper(space, save=""): try: import hyperopt except ImportError: print "Cannot find hyperopt. To use this converter, modify $PYTHONPATH to contain a hyperopt installation" return tpe_to_smac.convert_tpe_to_smac_from_file(space)