137 lines
2.2 KiB
Python
137 lines
2.2 KiB
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
number_of_noise_steps = 20
|
|
noise_scale = np.arange(0, number_of_noise_steps + 1) / float(
|
|
number_of_noise_steps
|
|
)
|
|
|
|
# 1x
|
|
|
|
data = np.load("avg_pooling_mlp/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
label="MLP"
|
|
)
|
|
|
|
data = np.load("basis_mlp/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
label="MLP Basis"
|
|
)
|
|
|
|
|
|
data = np.load("avg_pooling_nnmf/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
label="NNMF"
|
|
)
|
|
|
|
data = np.load("avg_pooling_nnmf_sp1.01/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
label="NNMF Sparse 1.01"
|
|
)
|
|
|
|
data = np.load("basis_nnmf/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
label="NNMF Basis"
|
|
)
|
|
|
|
# 2x
|
|
|
|
data = np.load("avg_pooling_mlp_x2/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
":",
|
|
label="MLP x2"
|
|
)
|
|
|
|
data = np.load("basis_mlp_x2/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
":",
|
|
label="MLP Basis x2"
|
|
)
|
|
|
|
|
|
data = np.load("avg_pooling_nnmf_x2/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
":",
|
|
label="NNMF x2"
|
|
)
|
|
|
|
data = np.load("avg_pooling_nnmf_sp1.01_x2/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
":",
|
|
label="NNMF Sparse 1.01 x2"
|
|
)
|
|
|
|
data = np.load("basis_nnmf_x2/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
":",
|
|
label="NNMF Basis x2"
|
|
)
|
|
|
|
# 4x
|
|
|
|
data = np.load("avg_pooling_mlp_x4/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
"--",
|
|
label="MLP x4"
|
|
)
|
|
|
|
data = np.load("basis_mlp_x4/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
"--",
|
|
label="MLP Basis x4"
|
|
)
|
|
|
|
|
|
data = np.load("avg_pooling_nnmf_x4/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
"--",
|
|
label="NNMF x4"
|
|
)
|
|
|
|
data = np.load("avg_pooling_nnmf_sp1.01_x4/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
"--",
|
|
label="NNMF Sparse 1.01 x4"
|
|
)
|
|
|
|
data = np.load("basis_nnmf_x4/noise_uniform_results.npy")
|
|
plt.plot(
|
|
noise_scale,
|
|
data,
|
|
"--",
|
|
label="NNMF Basis x4"
|
|
)
|
|
|
|
plt.legend()
|
|
plt.xlabel("eta")
|
|
plt.ylabel("Performance [%]")
|
|
plt.title("CIFAR10 Uniform Noise")
|
|
plt.show()
|