def generate_multi_table(args): logger = ActiveExperimentLogger(args.exp_path) n_metrics = len(args.metrics) n_tasks = len(args.problems) table_latex = '\\begin{tabular}{|c|' # Add the appropriate number of columns: n_tasks*n_metrics for _ in range(n_tasks): single_task = '|' + '|'.join(['c']*n_metrics) + '|' table_latex += single_task table_latex += '}\n\\hline\n' # Add a title for each task. for tx, task in enumerate(args.problems): if tx == len(args.problems) - 1: task_name = ' & \\multicolumn{' + str(n_metrics) + '}{c|}{\\textbf{' + task_headings[task] + '}}' else: task_name = ' & \\multicolumn{' + str(n_metrics) + '}{c||}{\\textbf{' + task_headings[task] + '}}' table_latex += task_name table_latex += '\\\\ \n\\hline\n' # For each task, add metric columns. table_latex += '\\textbf{APF Model} ' for _ in range(n_tasks): table_latex += '& ' + ' & '.join(['\\textbf{' + metric_headings[m] + '}' for m in args.metrics]) table_latex += '\\\\ \\hline\n' for method in args.planning_models: table_latex += method_headings[method] for task in args.problems: results = logger.get_evaluation_labels(task, method, args.acquisition_step) if len(results) > 0: results = list(results.values())[0] else: results = None for metric in args.metrics: if results is None: table_latex += ' & ' else: table_latex += ' & ' + metric_callbacks[metric](results, task) table_latex += '\\\\\n' table_latex += '\\hline\n' table_latex += '\end{tabular}\n' return table_latex
def generate_single_table(args): logger = ActiveExperimentLogger(args.exp_path) n_metrics = len(args.metrics) table_latex = '\\begin{tabular}{|c|' + '|'.join(['c']*n_metrics) + '|}\n\\hline\n' table_latex += '\\textbf{APF Model} & ' + ' & '.join(['\\textbf{' + metric_headings[m] + '}' for m in args.metrics]) + ' \\\\\n' table_latex += '\\hline\n' for method in args.planning_models: table_latex += method_headings[method] results = logger.get_evaluation_labels(args.problems[0], method, args.acquisition_step) results = list(results.values())[0] for metric in args.metrics: table_latex += ' & ' + metric_callbacks[metric](results, args.problem) table_latex += '\\\\\n' table_latex += '\\hline\n' table_latex += '\end{tabular}\n' return table_latex