-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_params.py
More file actions
59 lines (43 loc) · 1.45 KB
/
plot_params.py
File metadata and controls
59 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import pickle
import matplotlib.pyplot as plt
import numpy as np
file = "params_20241221-134245.pckl"
with open(file, "rb") as f:
params = pickle.load(f)
fig, axs = plt.subplots(2, 2, figsize=(11, 8))
colors = ["tab:blue", "tab:orange", "tab:purple", "tab:green"]
mus = []
for x in params:
mus.append(x["mu"])
mus = np.array(mus)
for x in range(2):
for y in range(2):
axs[0, 0].plot(mus[:, x, y])
axs[0, 0].set_title("Trained values of $\\mu$")
axs[0, 0].set_xlabel("Training Iteration")
axs[0, 0].set_ylabel("Value")
cs = []
for x in params:
cs.append(x["c"])
cs = np.array(cs)
for x in range(4):
axs[0, 1].plot(cs[:, x])
axs[0, 1].set_title("Trained values of $c_k$")
axs[0, 1].set_xlabel("Training Iteration")
axs[0, 1].set_ylabel("Value")
axs[0, 1].legend([f"k = {i}" for i in range(1, 5)])
axs[1, 0].plot([x["theta"][0] for x in params])
axs[1, 0].plot([x["theta"][1] for x in params])
axs[1, 0].set_title("Trained values of $\\theta$")
axs[1, 0].set_xlabel("Training Iteration")
axs[1, 0].set_ylabel("Value")
axs[1, 0].legend([f"k = {i}" for i in range(1, 3)])
for i in range(4):
axs[1, 1].plot([x["initial"][i] for x in params])
axs[1, 1].set_title("Trained Values of $\\pi_0$")
axs[1, 1].set_xlabel("Training Iteration")
axs[1, 1].set_ylabel("Value")
axs[1, 1].legend([f"k = {i}" for i in range(1, 5)])
fig.suptitle("Learning Progress for Selected Parameters", fontsize=18)
fig.tight_layout()
fig.savefig("param_training.pdf")