Commit 0657bdd3 authored by David Trudgian's avatar David Trudgian
Browse files

Don't compute param combns for spearmint

parent f3a77aea
......@@ -169,7 +169,7 @@ class BaseExecutor(object):
if "score" in self.params.vals:
if self.params.vals["score"] in summary_dict:
summary_dict["_score"] = float(summary_dict[self.params.vals["score"]])
logger.debug("- Score for task %d: %0.4f", summary_dict["_task_index"], summary_dict["_score"])
logger.debug(" - Score for task %d: %0.4f", summary_dict["_task_index"], summary_dict["_score"])
self._write_trace(summary_dict)
......
......@@ -20,7 +20,7 @@ class GridSearchOptimizer(BaseOptimizer):
def run(self):
"""Run a grid search, passing all tasks to the executor immediately."""
tasks_total = len(self.params.commands)
logger.info("- Exhaustive grid search will run %d tasks" % tasks_total)
logger.info(" - Exhaustive grid search will run %d tasks" % tasks_total)
pool = self.executor.get_pool()
......@@ -31,8 +31,8 @@ class GridSearchOptimizer(BaseOptimizer):
pool.close()
pool.join()
logger.info("- Optimization completed after %d tasks run" % tasks_total)
logger.info("- Best score: %f\ttask %d", self.best_task['score'],
logger.info(" - Optimization completed after %d tasks run" % tasks_total)
logger.info(" - Best score: %f\ttask %d", self.best_task['score'],
self.best_task['task_index'])
def run_job(self, task_index, cmd):
......
......@@ -38,8 +38,8 @@ class SpearmintOptimizer(BaseOptimizer):
pool.terminate()
pool.join()
logger.info("- Optimization completed after %d tasks run", self.task_index + 1)
logger.info("- Best score: %f\ttask %d", self.best_task['score'],
logger.info(" - Optimization completed after %d tasks run", self.task_index + 1)
logger.info(" - Best score: %f\ttask %d", self.best_task['score'],
self.best_task['task_index'])
def attempt_dispatch(self, expt_config, pool, expt_dir, chooser):
......
......@@ -13,6 +13,7 @@ from yamllint.config import YamlLintConfig
logger = logging.getLogger(__name__)
# PATH TO MODULECMD
# TODO: make configurable nicely
MODULECMD = "/cm/local/apps/environment-modules/current/bin/modulecmd"
......@@ -155,8 +156,10 @@ class ParamFile(object):
if "summary" in self.vals:
self.__check_summary_regexes()
self.__check_score()
self.__compute_param_ranges()
self.commands = self.__compute_commands()
if "optimizer" not in self.vals or self.vals[
"optimizer"] == "gridsearch":
self.__compute_param_ranges()
self.commands = self.__compute_commands()
self.loaded = True
def __check_summary_regexes(self):
......@@ -186,7 +189,7 @@ class ParamFile(object):
if summary['id'] == self.vals['score']:
logging.info(
"- Using '%s' as score to minimize" % summary['id'])
" - Using '%s' as score to minimize" % summary['id'])
return
raise ValueError("Specified score '%s' is not a defined summary" %
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment