示例#1
0
def _check_state_dims(state):
    if not state.dim_names:
        flag_desc = ", ".join(op_util.flag_assigns(state.proto_flags))
        log.error(
            "flags for batch (%s) do not contain any search "
            "dimension - quitting", flag_desc)
        raise batch_util.StopBatch(error=True)
示例#2
0
def _check_state_dims(state):
    if not state.dim_names:
        log.error(
            "flags for batch (%s) do not contain any search "
            "dimension - quitting",
            op_util.flags_desc(state.proto_flags))
        raise batch_util.StopBatch(error=True)
示例#3
0
def gen_trials(flags,
               _runs,
               max_trials=None,
               random_seed=None,
               label=None,
               **kw):
    """Public interface for ipy."""
    if kw:
        log.warning("ignoring configuration %s", kw)
    num_trials = max_trials or DEFAULT_TRIALS
    dim_names, dims, _initials = skopt_util.flag_dims(flags)
    if not dim_names:
        log.error(
            "flags for batch (%s) do not contain any search "
            "dimension - quitting", op_util.flags_desc(flags))
        raise batch_util.StopBatch(error=True)
    trial_vals = _gen_trial_vals(dims, num_trials, random_seed)
    trial_opts = {"label": label or "random"}
    return [(_trial_flags(dim_names, dim_vals, flags), trial_opts)
            for dim_vals in trial_vals]