Skip to content

Commit

Permalink
Changed X^T @ (w w^T) @ X to (X^T w) * (w^T X) as suggested by Yu
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamgupta2 committed May 1, 2021
1 parent 06e3b61 commit 7758d10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file modified data/lhiding-loss-vs-m-pkl
Binary file not shown.
Binary file modified figs/lhiding-loss-vs-m.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion robustlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def alg(self, S, indicator):
eps_m = round(eps * m)
for i in range(nItrs):
if self.sparse:
Sigma_w = (X.T @ spdiags(w, 0, m, m) @ X) - (X.T @ np.outer(w, w) @ X)
Xw = X.T @ w
Sigma_w = (X.T @ spdiags(w, 0, m, m) @ X) - (Xw @ Xw.T)
Sigma_w_minus_I = Sigma_w - np.eye(d)
#find indices of largest k entries of each row of Sigma_w_minus_I
largest_k_each_row_index_array = np.argpartition(Sigma_w_minus_I, kth=-k, axis=-1)[:, -k:]
Expand Down

0 comments on commit 7758d10

Please sign in to comment.