def plot_specific(model_names): global model_manager if model_manager == None: results_path = '../results' model_manager = ModelsManager(results_path) for model_name in model_names: if model_manager.has_model(model_name): saved_model = model_manager.get_model(model_name) plot_single(saved_model)
def plot_bar_chart_average_success(model_names): global model_manager if model_manager == None: results_path = '../results' model_manager = ModelsManager(results_path) y_avg = [] y_max = [] formated_names = [] for model_name in model_names: if model_manager.has_model(model_name): saved_model = model_manager.get_model(model_name) epoch, train, test = saved_model.session_stats() avg_acc = np.mean(test) max_acc = np.max(test) y_avg.append(avg_acc) y_max.append(max_acc) formated_name = model_name.replace('conv_2_layer_', '').replace('_','\n') formated_names.append(formated_name) x = range(1,len(formated_names) + 1) plt.plot(x, y_avg, 'go', label='average') plt.plot(x, y_max, 'ro', label='max') plt.xticks(x, formated_names) #, rotation='vertical' plt.ylabel('average test accuracy') plt.subplots_adjust(bottom=0.25) plt.legend()