utils/doc_utils.py
def create_experiment_results_plot(title, parameter, dir, log=False):
    """
    create plot of chosen parameter during training
    :param title: the first part of plot title
    :param parameter: the parameter you want to plot. loss accuracy
    :param dir: the directory in which the plot will be saves
    :param log: boolean to chose if you want semilog scale
    :return: name of the saved plot file
    """
    df = pd.read_csv(filepath_or_buffer=dir + '/exp_summary.csv')
    epochs = df["epoch"]
    train_param = df["train_{0}".format(parameter)]

    test_param = df["test_{0}".format(parameter)]

    if log:
        plt.semilogy(epochs, train_param, 'r', label='train')
        plt.semilogy(epochs, test_param, 'b', label='test')
        plt.ylabel(parameter + " semilog")
        axes = plt.gca()
        axes.set_ylim([10 ** -3, 10 ** 1])
    else:
        plt.plot(epochs, train_param, 'r', label='train')
        plt.plot(epochs, test_param, 'b', label='test')
        plt.ylabel(parameter)
        axes = plt.gca()
        axes.set_ylim([0.1, 0.95])
    plt.xlabel('Epochs')


    plt.title(title)
    plt.legend()
    file_name = (os.path.join(dir, (title + parameter + ".png")))
    plt.savefig(file_name)

    plt.close()
    return file_name

    create plot of chosen parameter during training
    :param title: the first part of plot title
    :param parameter: the parameter you want to plot. loss accuracy
    :param dir: the directory in which the plot will be saves
    :param log: boolean to chose if you want semilog scale
    :return: name of the saved plot file
    
create plot of chosen parameter during training
create plot of chosen parameter during training
def create_experiment_results_plot(title, parameter, dir, log=False):
    df = pd.read_csv(filepath_or_buffer=dir + '/exp_summary.csv')
    epochs = df["epoch"]
    train_param = df["train_{0}".format(parameter)]
    test_param = df["test_{0}".format(parameter)]
    if log:
        plt.semilogy(epochs, train_param, 'r', label='train')
        plt.semilogy(epochs, test_param, 'b', label='test')
        plt.ylabel(parameter + " semilog")
        axes = plt.gca()
        axes.set_ylim([10 ** -3, 10 ** 1])
    else:
        plt.plot(epochs, train_param, 'r', label='train')
        plt.plot(epochs, test_param, 'b', label='test')
        plt.ylabel(parameter)
        axes = plt.gca()
        axes.set_ylim([0.1, 0.95])
    plt.xlabel('Epochs')
    plt.title(title)
    plt.legend()
    file_name = (os.path.join(dir, (title + parameter + ".png")))
    plt.savefig(file_name)
    plt.close()
    return file_name
def create_experiment_results_plot ( title , parameter , dir , log = False ) : df = pd . read_csv ( filepath_or_buffer = dir + '/exp_summary.csv' ) epochs = df [ "epoch" ] train_param = df [ "train_{0}" . format ( parameter ) ] test_param = df [ "test_{0}" . format ( parameter ) ] if log : plt . semilogy ( epochs , train_param , 'r' , label = 'train' ) plt . semilogy ( epochs , test_param , 'b' , label = 'test' ) plt . ylabel ( parameter + " semilog" ) axes = plt . gca ( ) axes . set_ylim ( [ 10 ** - 3 , 10 ** 1 ] ) else : plt . plot ( epochs , train_param , 'r' , label = 'train' ) plt . plot ( epochs , test_param , 'b' , label = 'test' ) plt . ylabel ( parameter ) axes = plt . gca ( ) axes . set_ylim ( [ 0.1 , 0.95 ] ) plt . xlabel ( 'Epochs' ) plt . title ( title ) plt . legend ( ) file_name = ( os . path . join ( dir , ( title + parameter + ".png" ) ) ) plt . savefig ( file_name ) plt . close ( ) return file_name
create plot of chosen parameter during training
create plot of chosen parameter during training
"""
    create plot of chosen parameter during training
    :param title: the first part of plot title
    :param parameter: the parameter you want to plot. loss accuracy
    :param dir: the directory in which the plot will be saves
    :param log: boolean to chose if you want semilog scale
    :return: name of the saved plot file
    """
name of the saved plot file
name of the saved plot file
title
the first part of plot title
the first part of plot title
parameter
the parameter you want to plot. loss accuracy
the parameter you want to plot . loss accuracy
dir
the directory in which the plot will be saves
the directory in which the plot will be saves
log
boolean to chose if you want semilog scale
boolean to chose if you want semilog scale