Skip to content

Commit 478b9e1

Browse files
committed
Updated RMR and sparse plus low rank notebooks
1 parent 0a6ab03 commit 478b9e1

4 files changed

Lines changed: 149 additions & 423 deletions

File tree

examples/matrix_spare_plus_low_rank.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import portpy.photon as pp
88
from compress_rtp.compress_rtp_optimization import CompressRTPOptimization
99
from compress_rtp.utils.get_sparse_plus_low_rank import get_sparse_plus_low_rank
10+
from compress_rtp.utils.get_sparse_only import get_sparse_only
1011
import matplotlib.pyplot as plt
1112
from copy import deepcopy
1213

@@ -70,7 +71,9 @@ def sparse_plus_low_rank():
7071
# run optimization with naive thresold of 1% of max(A) and no low rank
7172
# create cvxpy problem using the clinical criteria and optimization parameters
7273
A = deepcopy(inf_matrix.A)
73-
S = get_sparse_plus_low_rank(A=A, thresold_perc=1, rank=0)
74+
S = get_sparse_only(matrix=A, threshold_perc=1)
75+
# Users can also use below method to get sparse matrix using threshold. Rank=0 is equivalent to above method
76+
# S = get_sparse_plus_low_rank(A=A, thresold_perc=1, rank=0)
7477
inf_matrix.A = S
7578
opt = pp.Optimization(my_plan, inf_matrix=inf_matrix, opt_params=opt_params)
7679
opt.create_cvxpy_problem()

0 commit comments

Comments
 (0)