Skip to content

Commit f66ae7f

Browse files
committed
Compute covariance matrix in float64.
1 parent 4a1a45a commit f66ae7f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/spikeinterface/preprocessing/whiten.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(self, parent_recording_segment, W, M, dtype, int_scale):
124124
def get_traces(self, start_frame, end_frame, channel_indices):
125125
traces = self.parent_recording_segment.get_traces(start_frame, end_frame, slice(None))
126126
traces_dtype = traces.dtype
127-
# if uint --> force int
127+
# if uint --> force float
128128
if traces_dtype.kind == "u":
129129
traces = traces.astype("float32")
130130

@@ -185,6 +185,7 @@ def compute_whitening_matrix(
185185
186186
"""
187187
random_data = get_random_data_chunks(recording, concatenated=True, return_scaled=False, **random_chunk_kwargs)
188+
random_data = random_data.astype(np.float64)
188189

189190
regularize_kwargs = regularize_kwargs if regularize_kwargs is not None else {"method": "GraphicalLassoCV"}
190191

0 commit comments

Comments
 (0)