-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_k_nceloss.py
45 lines (37 loc) · 992 Bytes
/
plot_k_nceloss.py
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
#!/usr/bin/env python
# coding: utf-8
import matplotlib.pyplot as plt
import numpy as np
import style
from plot_k_msuploss import lb_intercept, nceloss_min, suploss_min
def plot_curve(k, c, color):
nceloss = nceloss_min(k, c)
suploss = suploss_min(c) * np.ones_like(k)
b0 = lb_intercept(k, c)
plt.plot(
k,
suploss - b0,
"-",
lw=3,
color=color,
label=r"$R_{\mu\mathchar`-\mathrm{supv}}^* - \Delta_\mathrm{L}$ ($C="
+ str(c)
+ r"$)",
)
plt.plot(
k,
nceloss,
":",
lw=3,
color=color,
label=r"$R_\mathrm{cont}^*$ ($C=" + str(c) + r"$)",
)
if __name__ == "__main__":
k = np.arange(1, 100, 1)
plt.figure(figsize=(5, 3))
plot_curve(k, c=50, color="C1")
plot_curve(k, c=100, color="C2")
plt.xlabel(r"$K$")
plt.legend(loc="lower right")
plt.tight_layout()
plt.savefig("k_nceloss.pdf", bbox_inches="tight", pad_inches=0.1)