# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# +
import sys
import os
import matplotlib.pylab as plt
import seaborn as sns
import glob

sys.path.append('..')

import ghiaseddin
import re
# %matplotlib inline
# -

def plot_file(faddrs):
    sns.set_context("notebook")
    fig = plt.figure(figsize=(12, 6))
    ax = fig.add_subplot(111)
    ax.set_ylim(50, 100)
    ax.set_ylabel('accuracy (%)')
    ax.set_xlabel('epochs')
    
    if not isinstance(faddrs, list):
        faddrs = [faddrs]
    
    for faddr in faddrs:
        with open(faddr, 'r') as f:
            lines = f.readlines()
        lines = [float(l) for l in lines]
        ax.plot(lines)
    plt.show()
    plt.close()


dataset = 'LFW10' #'Zap1', 'LFW10'
randomseed = '*' #'0', '1', '2', '3', '4'

results = glob.glob(os.path.join(ghiaseddin.settings.result_models_root,
                                 'acc|baseline|*-d:%s-*-rs:%s-*' % (dataset, randomseed)))
print len(results)

plot_file(results)



StarcoderdataJupyterScriptsDedupFiltered