-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numerical instability of NNSED #56
Comments
Could you open a PR?
…On Thu, 5 Nov 2020 at 11:51, Kwan ***@***.***> wrote:
When I implemented NNSED on my own network, I encountered the following
problem:
C:\Users\Administrator\anaconda3\lib\site-packages\karateclub\community_detection\overlapping\nnsed.py:75:
RuntimeWarning: invalid value encountered in true_divide
self._W = self._W*(enum/denom)
and this is caused by some zero entries in *denom*.
After adding the following codes, my issues are resolved successfully, and
NNSED can now converge.
def _update_W(self, A):
enum = A.dot(self._Z.T)
denom_1 = self._W.dot(self._Z).dot(self._Z.T)
denom_2 = (A.dot(A.transpose())).dot(self._W)
denom = denom_1 + denom_2 + **1e-6**
self._W = self._W*(enum/denom)
def _update_Z(self, A):
enum = (A.dot(self._W)).transpose()
denom = np.dot(np.dot(self._W.T, self._W), self._Z) + self._Z + **1e-6**
self._Z = self._Z*(enum/denom)
I hope this could be fixed in the next version.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEETMFZO6RKAIVJYSWEZBYLSOKGV3ANCNFSM4TLIMJ7A>
.
|
Fixed it. |
Ahh sry. I noticed that you fixed the problem. Haha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I implemented NNSED on my own network, I encountered the following problem:
and this is caused by some zero entries in denom.
After adding the following codes, my issues are resolved successfully, and NNSED can now converge.
I hope this could be fixed in the next version.
The text was updated successfully, but these errors were encountered: