import matplotlib.pyplot as plt
import numpy as np

acc_GD = np.load('results/acc_CIFAR10_GD_lr0.01000_duration0.10_momentum0.000_mu0.00.npy')
acc_GDM = np.load('results/acc_CIFAR10_GD_lr0.01000_duration0.10_momentum0.900_mu0.00.npy')
acc_HD10 = np.load('results/acc_CIFAR10_HD_lr0.01000_duration0.10_momentum0.000_mu0.00.npy')
acc_HD20 = np.load('results/acc_CIFAR10_HD_lr0.01000_duration0.20_momentum0.000_mu0.00.npy')
acc_HD30 = np.load('results/acc_CIFAR10_HD_lr0.01000_duration0.30_momentum0.000_mu0.00.npy')
acc_HD50 = np.load('results/acc_CIFAR10_HD_lr0.01000_duration0.50_momentum0.000_mu0.00.npy')

loss_GD = np.load('results/loss_CIFAR10_GD_lr0.01000_duration0.10_momentum0.000_mu0.00.npy')
loss_GDM = np.load('results/loss_CIFAR10_GD_lr0.01000_duration0.10_momentum0.900_mu0.00.npy')
loss_HD10 = np.load('results/loss_CIFAR10_HD_lr0.01000_duration0.10_momentum0.000_mu0.00.npy')
loss_HD20 = np.load('results/loss_CIFAR10_HD_lr0.01000_duration0.20_momentum0.000_mu0.00.npy')
loss_HD30 = np.load('results/loss_CIFAR10_HD_lr0.01000_duration0.30_momentum0.000_mu0.00.npy')
loss_HD50 = np.load('results/loss_CIFAR10_HD_lr0.01000_duration0.50_momentum0.000_mu0.00.npy')

x_axis = np.arange(len(acc_GD))

# fig1 = plt.figure()
# plt.plot(x_axis, acc_GD, '-v', linewidth=2, markevery=5, markersize=10, color = 'skyblue', label=r'GD')
# plt.plot(x_axis, acc_GDM, '->', linewidth=2, markevery=5, markersize=10, color = 'royalblue', label=r'HB')
# plt.plot(x_axis, acc_HD20, '-*', linewidth=2, markevery=5, markersize=10, color = 'orange', label=r'HD')
# plt.xticks(fontsize=15)
# plt.yticks(fontsize=15)
# plt.title(r'Testing Accuracy', fontsize=20)
# plt.xlabel(r'Number of Epochs', fontsize=15)
# plt.ylabel(r'Testing Accuracy', fontsize=15)
# plt.grid(True)
# plt.legend(prop = {'size': 15})
# plt.savefig('pictures/acc_CIFAR10_algo.eps')

# fig2 = plt.figure()
# plt.plot(x_axis, loss_GD, '-v', linewidth=2, markevery=5, markersize=10, color = 'skyblue', label=r'GD')
# plt.plot(x_axis, loss_GDM, '->', linewidth=2, markevery=5, markersize=10, color = 'royalblue', label=r'HB')
# plt.plot(x_axis, loss_HD20, '-*', linewidth=2, markevery=5, markersize=10, color = 'orange', label=r'HD')
# plt.xticks(fontsize=15)
# plt.yticks(fontsize=15)
# plt.title(r'Training Loss', fontsize=20)
# plt.xlabel(r'Number of Epochs', fontsize=15)
# plt.ylabel(r'Training Loss', fontsize=15)
# plt.grid(True)
# plt.legend(prop = {'size': 15})
# plt.savefig('pictures/loss_CIFAR10_algo.eps')

fig1 = plt.figure()
plt.plot(x_axis, acc_HD10, '-v', linewidth=2, markevery=5, markersize=10, color = 'skyblue', label=r'HD-0.1')
plt.plot(x_axis, acc_HD20, '->', linewidth=2, markevery=5, markersize=10, color = 'royalblue', label=r'HD-0.2')
plt.plot(x_axis, acc_HD30, '-*', linewidth=2, markevery=5, markersize=10, color = 'darkblue', label=r'HD-0.3')
plt.plot(x_axis, acc_HD50, '-x', linewidth=2, markevery=5, markersize=10, color = 'black', label=r'HD-0.5')
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.title(r'Testing Accuracy', fontsize=20)
plt.xlabel(r'Number of Epochs', fontsize=15)
plt.ylabel(r'Testing Accuracy', fontsize=15)
plt.grid(True)
plt.legend(prop = {'size': 15})
plt.savefig('pictures/acc_CIFAR10_duration.eps')

fig2 = plt.figure()
plt.plot(x_axis, loss_HD10, '-v', linewidth=2, markevery=5, markersize=10, color = 'skyblue', label=r'HD-0.1')
plt.plot(x_axis, loss_HD20, '->', linewidth=2, markevery=5, markersize=10, color = 'royalblue', label=r'HD-0.2')
plt.plot(x_axis, loss_HD30, '-*', linewidth=2, markevery=5, markersize=10, color = 'darkblue', label=r'HD-0.3')
plt.plot(x_axis, loss_HD50, '-x', linewidth=2, markevery=5, markersize=10, color = 'black', label=r'HD-0.5')
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.title(r'Training Loss', fontsize=20)
plt.xlabel(r'Number of Epochs', fontsize=15)
plt.ylabel(r'Training Loss', fontsize=15)
plt.grid(True)
plt.legend(prop = {'size': 15})
plt.savefig('pictures/loss_CIFAR10_duration.eps')

plt.show()