예제 #1
0
both_colors = []
both_data_names = []

special_histories = []
for i in range(0, len(data_paths)):
    special_histories.append(loadHistory(data_paths[i]))
    special_histories[i] = count_averages(special_histories[i], 'loss')

    both_colors.append(light_colors[i])
    both_colors.append(hard_colors[i])
    both_data_names.append(train_data_names[i])
    both_data_names.append("validation " + val_data_names[i])

custom_title = 'Validation error in last epoch'

import matplotlib.pyplot as plt

plt, figure = boxplots_in_row(plt, special_histories, val_data_names)
figure.set_size_inches((8, 6))

# Now check everything with the defaults:
DPI = figure.get_dpi()
print "DPI:", DPI
DefaultSize = figure.get_size_inches()
print "Default size in Inches", DefaultSize
print "Which should result in a %i x %i Image" % (DPI * DefaultSize[0],
                                                  DPI * DefaultSize[1])

save_plot(plt, True, out_folder)

finally_show(plt)
예제 #2
0
import matplotlib.pyplot as plt
#custom_title = 'Validation error averages'
#plt = plot_only_averages(plt, special_histories, val_data_names, hard_colors, custom_title)
#custom_title = 'Training error averages'
#plt = plot_only_averages(plt, special_histories, train_data_names, light_colors, custom_title, just='train')
custom_title = 'Validation and Training error averages, 299px'
plt = plot_only_averages(plt, special_histories, both_data_names, both_colors, custom_title, just='both',
                         save=[SAVE,out_folder_1])

# FIGURE 2

custom_title = 'Base model comparison, 299px'

colors = []
for c in hard_colors:
    colors.append(c)
    colors.append(c)

names_to_print = []
for i in val_data_names:
    names_to_print.append(i + 'average val')
    names_to_print.append(i + 'val')

print colors
print names_to_print

plt = plot_together(special_histories, names_to_print, colors, custom_title)
save_plot(plt, SAVE, out_folder_2)

finally_show(plt)
special_histories = []
for i in range(0, len(data_paths)):
    special_histories.append(loadHistory(data_paths[i]))
    special_histories[i] = count_averages(special_histories[i], 'loss')

custom_title = 'Validation error in last epoch'

import matplotlib.pyplot as plt
plt, figure = boxplots_in_row_custom611(plt,
                                        special_histories,
                                        data_names,
                                        BestInstead=True,
                                        just='both',
                                        forced_ymax=0.16)

figure.suptitle(custom_title)  # needs adjustment of the top value
save_plot(plt, True, out_folder_1)

#finally_show(plt)

names_to_print = ["299x299 average val", "299x299 val"]
names_to_print += ["640x640 average val", "640x640 val"]
custom_title = 'Pixel size comparison'

colors = ["green", "green", "red", "red"]

plt = plot_together(special_histories, names_to_print, colors, custom_title)
save_plot(plt, SAVE, out_folder_2)

finally_show(plt)