-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_plots.py
77 lines (63 loc) · 1.27 KB
/
demo_plots.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import numpy as np
from matrix_util import *
from demo_cauchy import *
num_shot = 200
dim = 40
p_dim = 240
sigma = 0.1
min_x = -5
max_x = 20
diag_A = np.arange(dim)/10
A = rectangular_diag(diag_A,p_dim, dim)
scale = 1e-1
plot_density(A, sigma,scale, min_x, max_x, \
num_shot=num_shot,jobname="240by40")
dim = 64
p_dim = dim
scale = 1e-3
sigma = 0.1
min_x = -0.1
max_x = 0.1
diag_A = np.zeros(dim)
A = rectangular_diag(diag_A,p_dim, dim)
num_shot = 200
plot_density(A, sigma,scale, min_x, max_x, \
num_shot=num_shot,jobname="MP")
dim = 64
p_dim = dim
scale = 1e-3
sigma = 0.1
min_x = 0
max_x = 2
diag_A = np.ones(dim)
A = rectangular_diag(diag_A,p_dim, dim)
num_shot = 200
plot_density(A, sigma,scale, min_x, max_x, \
num_shot=num_shot,jobname="identity")
dim = 64
p_dim = dim
scale = 1e-3
sigma = 0.1
min_x = -0.1
max_x = 0.5
a = 5*np.ones(dim)
half = int(dim/2)
for i in range(half):
a[i] = 2
diag_A = a/10
A = rectangular_diag(diag_A,p_dim, dim)
num_shot = 200
plot_density(A, sigma,scale, min_x, max_x, \
num_shot=num_shot,jobname="2-5")
dim = 64
p_dim = dim
scale = 1e-2
sigma = 0.1
min_x = -1
max_x = 12
a = np.arange(64) + 1
diag_A = a/20
A = rectangular_diag(diag_A,p_dim, dim)
num_shot = 400
plot_density(A, sigma,scale, min_x, max_x, \
num_shot=num_shot,jobname="64")