def plot_hamming_dist(s,W,brec):
masks = s[:,0,:].T>0
x_hat = np.zeros(masks.shape)
for ii in range(masks.shape[1]):
Weff = W*masks[:,ii]
x_hat[:,ii] = np.linalg.inv(np.eye(100)-Weff).dot(brec)
fig = plt.figure()
plt.pcolormesh(squareform(pdist(np.sign(x_hat[:,:]).T,metric='hamming'))) #,vmax=.3)
plt.colorbar()
plt.ylim([0,x_hat.shape[1]])
plt.xlim([0,x_hat.shape[1]])
plt.axes().set_aspect('equal')
plt.title('Hamming Distance Between Putative FPs')
plt.ylabel('Time')
plt.xlabel('Time')
return fig
评论列表
文章目录