Skip to content

Commit addb339

Browse files
Jacky ZhangJacky Zhang
Jacky Zhang
authored and
Jacky Zhang
committedApr 8, 2021
add simplex constraint
1 parent 0586081 commit addb339

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed
 

‎IHT_toolbox/toolbox_examples.py

-12
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@
2929
true_w[true_supp] = np.random.rand(K, 1)
3030
y = A.dot(true_w)
3131

32-
# projection
33-
w = np.array([1, -1, -0.5, 0]).reshape([-1, 1])
34-
k_proj = 2
35-
w_projected, supp = l2_projection_numpy(w, k_proj, L=2)
36-
print('original w: {}. Sparsity: {}'.format(w, k_proj))
37-
print('projected w: {}'.format(w_projected))
38-
print('support: {}'.format(supp))
39-
w_projected, supp = l2_projection_numpy(w, k_proj, L=2, K_sparse_supp=[0, 1], already_K_sparse=True)
40-
print('projected w: {}'.format(w_projected))
41-
print('support: {}'.format(supp))
42-
43-
4432
# A-IHT I by numpy
4533
print('\nusing A-IHT I by numpy...')
4634
w, supp = a_iht_i(y, A, K, L=L)

0 commit comments

Comments
 (0)
Please sign in to comment.