Skip to content

Commit

Permalink
add noise to diagonal of matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
m-julian committed Apr 10, 2024
1 parent 6fff2c9 commit 17eb594
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def form_g_matrix(b_matrix: np.ndarray):
"""

g_matrix = np.matmul(b_matrix, b_matrix.T)
# add some noise on the diagonal to ensure that it is positive semidefinite
# also numerically helps
g_matrix += np.diag(1e-07 * g_matrix.shape[0])
return g_matrix


Expand Down

0 comments on commit 17eb594

Please sign in to comment.