haoyangliASTAPLE / 3DFed

35 stars 4 forks source link

Incorrect implement of Deepsight #11

Open ysinwell opened 4 months ago

ysinwell commented 4 months ago

Hi, I may find a mistake in the deepsight.py. In line 176 of the function dists_from_clust,pairwise_dists = np.ones((N,N))suppose to be modifed to pairwise_dists = np.zeros((N,N)).Otherwise, pairwise_dists[i][j]=1 in line 181 is wrong while assighing value 1 to a ones array is meaningless. This mistake would make deepsight invalid.So I conduct a simple reproduction: without modifing the code ,the best backdoor result is 96.88 while the result decline to only 68.22 after modified.

Elonisme commented 3 months ago

I alse find this error:

def dists_from_clust(clusters, N):
    pairwise_dists = np.ones((N,N))
    for i in clusters:
        for j in clusters:
            if i==j:
                pairwise_dists[i][j]=1
    return pairwise_dists

It is meaningless!