Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13921

Pytorch Clustering of Model Parameters with high dimensional data

$
0
0

I am trying to cluster the model parameters to separate benign and malicious ones into 2 clusters using kmeans. However, as it is a high dimensional data(approx 3 lakh parameters), I am getting an error which says:*ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (10, 1) + inhomogeneous part.

  • . Can anyone please guide me here ....

local_dict.append(torch.stack([client_models[i].state_dict()[k]],0).cpu().detach().numpy())kmeans=KMeans(n_clusters=2,random_state=0).fit(local_dict)ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (10, 1) + inhomogeneous part.


Viewing all articles
Browse latest Browse all 13921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>