src/orion/algo/hyperband.py
def display_budgets(budgets_tab, max_resources, reduction_factor):
    """Display hyperband budget as a table in debug log"""
    num_brackets = len(budgets_tab[0])
    table_str = "Display Budgets:\n"
    col_format_str = "{:<4}" + " {:<12}" * num_brackets + "\n"
    col_title_list = ["i  "] + ["n_i  r_i"] * num_brackets
    col_sub_list = ["---"] + ["---------"] * num_brackets
    table_str += col_format_str.format(*col_sub_list)
    table_str += col_format_str.format(*col_title_list)
    table_str += col_format_str.format(*col_sub_list)

    total_trials = 0
    for key, values in budgets_tab.items():
        table_row = "{:<4} ".format(key)
        for value in values:
            n_i, r_i = value
            total_trials += n_i
            st = "{:<5} {:<7}".format(n_i, r_i)
            table_row += st
        table_str += table_row + "\n"
    table_str += col_format_str.format(*col_sub_list)
    table_str += "max resource={}, eta={}, trials number of one execution={}\n".format(
        max_resources, reduction_factor, total_trials
    )
    logger.debug(table_str)
Display hyperband budget as a table in debug log
Display hyperband budget as a table in debug log
Display hyperband budget as a table in debug log
def display_budgets(budgets_tab, max_resources, reduction_factor):
    num_brackets = len(budgets_tab[0])
    table_str = "Display Budgets:\n"
    col_format_str = "{:<4}" + " {:<12}" * num_brackets + "\n"
    col_title_list = ["i  "] + ["n_i  r_i"] * num_brackets
    col_sub_list = ["---"] + ["---------"] * num_brackets
    table_str += col_format_str.format(*col_sub_list)
    table_str += col_format_str.format(*col_title_list)
    table_str += col_format_str.format(*col_sub_list)
    total_trials = 0
    for key, values in budgets_tab.items():
        table_row = "{:<4} ".format(key)
        for value in values:
            n_i, r_i = value
            total_trials += n_i
            st = "{:<5} {:<7}".format(n_i, r_i)
            table_row += st
        table_str += table_row + "\n"
    table_str += col_format_str.format(*col_sub_list)
    table_str += "max resource={}, eta={}, trials number of one execution={}\n".format(
        max_resources, reduction_factor, total_trials
    )
    logger.debug(table_str)
def display_budgets ( budgets_tab , max_resources , reduction_factor ) : num_brackets = len ( budgets_tab [ 0 ] ) table_str = "Display Budgets:\n" col_format_str = "{:<4}" + " {:<12}" * num_brackets + "\n" col_title_list = [ "i  " ] + [ "n_i  r_i" ] * num_brackets col_sub_list = [ "---" ] + [ "---------" ] * num_brackets table_str += col_format_str . format ( * col_sub_list ) table_str += col_format_str . format ( * col_title_list ) table_str += col_format_str . format ( * col_sub_list ) total_trials = 0 for key , values in budgets_tab . items ( ) : table_row = "{:<4} " . format ( key ) for value in values : n_i , r_i = value total_trials += n_i st = "{:<5} {:<7}" . format ( n_i , r_i ) table_row += st table_str += table_row + "\n" table_str += col_format_str . format ( * col_sub_list ) table_str += "max resource={}, eta={}, trials number of one execution={}\n" . format ( max_resources , reduction_factor , total_trials ) logger . debug ( table_str )
Display hyperband budget as a table in debug log
Display hyperband budget as a table in debug log
"""Display hyperband budget as a table in debug log"""
budgets_tab
max_resources
reduction_factor