You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\Users\Fatih\DGN-master\config.py", line 61, in
X = helper.create_better_simulated(N_Subjects, N_Nodes) if N_views == 4 else helper.simulate_dataset(N_Subjects, N_Nodes, N_views)
File "C:\Users\Fatih\DGN-master\helper.py", line 18, in create_better_simulated
view1 = np.array([antiVectorize(v, N_ROIs) for v in view1])
File "C:\Users\Fatih\DGN-master\helper.py", line 18, in
view1 = np.array([antiVectorize(v, N_ROIs) for v in view1])
File "C:\Users\Fatih\DGN-master\helper.py", line 77, in antiVectorize
M[np.tril_indices(m,k=-1)] = vec
ValueError: shape mismatch: value array of shape (630,) could not be broadcast to indexing result of shape (595,)
My solution:
def antiVectorize(vec, m):
il = np.tril_indices(m, k=0)
M = np.zeros((m, m))
M[il] = vec
M = M.T
M[il] = vec
M[np.diag_indices(m)] = 0
return M
The text was updated successfully, but these errors were encountered:
turingelir
changed the title
"ValueError: shape mismatch" in antiVectorize of helper.py. I've attached my solution.
"ValueError: shape mismatch" in antiVectorize of helper.py. I've included my solution in this comment.
Jan 5, 2022
Bug log:
File "C:\Users\Fatih\DGN-master\config.py", line 61, in
X = helper.create_better_simulated(N_Subjects, N_Nodes) if N_views == 4 else helper.simulate_dataset(N_Subjects, N_Nodes, N_views)
File "C:\Users\Fatih\DGN-master\helper.py", line 18, in create_better_simulated
view1 = np.array([antiVectorize(v, N_ROIs) for v in view1])
File "C:\Users\Fatih\DGN-master\helper.py", line 18, in
view1 = np.array([antiVectorize(v, N_ROIs) for v in view1])
File "C:\Users\Fatih\DGN-master\helper.py", line 77, in antiVectorize
M[np.tril_indices(m,k=-1)] = vec
ValueError: shape mismatch: value array of shape (630,) could not be broadcast to indexing result of shape (595,)
My solution:
The text was updated successfully, but these errors were encountered: