Skip to content

Commit

Permalink
Fixed bug with power iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
AryazE authored and miso-belica committed Aug 11, 2023
1 parent 2f6c959 commit 8d29125
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sumy/summarizers/lex_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def power_method(matrix, epsilon):

while lambda_val > epsilon:
next_p = numpy.dot(transposed_matrix, p_vector)
next_p /= numpy.linalg.norm(next_p)
lambda_val = numpy.linalg.norm(numpy.subtract(next_p, p_vector))
p_vector = next_p

Expand Down

0 comments on commit 8d29125

Please sign in to comment.