Bernstein_Poster_2024/plot.py

93 lines
2.5 KiB
Python
Raw Permalink Normal View History

2024-10-21 16:43:42 +02:00
import numpy as np
import matplotlib.pyplot as plt
data = np.load("./basis_nnmf/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy")
plt.loglog(data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), "k", label="basis nnmf")
data = np.load("./basis_mlp/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy")
plt.loglog(data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), "k--", label="basis mlp")
data = np.load(
"./basis_nnmf_autograd/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), "k:", label="basis nnmf autograd"
)
data = np.load("./basis_conv2d/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy")
plt.loglog(
data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), "k-.", label="basis conv2d"
)
# ----
data = np.load(
"./max_pooling_nnmf/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), label="nnmf max pooling")
data = np.load(
"./avg_pooling_nnmf/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), label="nnmf average pooling"
)
data = np.load(
"./avg_pooling_nnmf_noinbetween1x1/data_log_iter20_lr_-_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0],
100.0 * (1.0 - data[:, 1] / 10000.0),
label="nnmf average noinbetween1x1",
)
# ----
data = np.load(
"./avg_pooling_conv2d/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0],
100.0 * (1.0 - data[:, 1] / 10000.0),
label="conv2d average pooling (breaks during learning)",
)
data = np.load(
"./avg_pooling_conv2d_noinbetween1x1/data_log_iter20_lr_-_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0],
100.0 * (1.0 - data[:, 1] / 10000.0),
label="conv2d average noinbetween1x1",
)
# ----
data = np.load(
"./max_pooling_mlp/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), label="mlp max pooling")
data = np.load(
"./avg_pooling_mlp/data_log_iter20_lr_1.0000e-03_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0], 100.0 * (1.0 - data[:, 1] / 10000.0), label="mlp average pooling"
)
data = np.load(
"./avg_pooling_mlp_noinbetween1x1/data_log_iter20_lr_-_1.0000e-02_1.0000e-03_.npy"
)
plt.loglog(
data[:, 0],
100.0 * (1.0 - data[:, 1] / 10000.0),
label="mlp average noinbetween1x1",
)
plt.legend()
plt.xlabel("Epoch")
plt.ylabel("Error [%]")
plt.title("CIFAR10")
plt.show()