import os import pandas as pd import matplotlib.pyplot as plt file_name = 'gain.csv' file = pd.read_csv(os.path.abspath(file_name)) # plot runtime & memory plt.figure() plt.subplot(211) plt.plot(file['time with AE'], color='b', label='with AE') plt.plot(file['time without AE'], color='r', linestyle='dashed', label='without AE') plt.ylabel('Time to Run(s)') plt.subplot(212) plt.plot(file['size with AE'], 'b', label='with AE') plt.plot(file['size without AE'], color='r', linestyle='dashed', label='without AE') plt.xlabel('Compression Ratio') plt.ylabel('Memories(bytes)') plt.savefig(file_name) plt.show() # plot loss & spi & sai plt.figure() plt.subplot(311) plt.plot(file['loss'], 'b') plt.ylabel('Reconstruction Loss') plt.subplot(312) plt.plot(file['spi'], 'b') plt.ylabel('SPI') plt.subplot(313) plt.plot(file['sai'], 'b') plt.xlabel('Compression Ratio') plt.ylabel('SAI') # plt.savefig(file_name) plt.show()