Skip to content

Commit

Permalink
update measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Mar 21, 2022
1 parent 75d92fb commit ed4e5e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions brainpy/measure/correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def matrix_correlation(x, y):
return cc


@jit
def functional_connectivity(activities):
"""Functional connectivity matrix of timeseries activities.
Expand All @@ -200,12 +199,12 @@ def functional_connectivity(activities):
connectivity_matrix: tensor
``num_sample x num_sample`` functional connectivity matrix.
"""
activities = bm.asarray(activities)
activities = bm.as_numpy(activities)
if activities.ndim != 2:
raise ValueError('Only support 2d tensor with shape of "(num_time, num_sample)". '
f'But we got a tensor with the shape of {activities.shape}')
fc = bm.corrcoef(activities.T)
return bm.nan_to_num(fc)
fc = np.corrcoef(activities.T)
return np.nan_to_num(fc)


@jit
Expand Down

0 comments on commit ed4e5e5

Please sign in to comment.