Skip to content

Wrong shape in block covariance matrix #5

@fedezuc

Description

@fedezuc

U = np.zeros([len(np.arange(0, n_times - 1, window)), n_ch**2])

When data has shape of (4,17302), window = 100 gives error

ValueError: cannot reshape array of size 2768 into shape (174,16)

And it does the same with every n_samples in the shape of

xxxx02

I think it is an approximation problem when creating the matrix U.
I patched it by creating the matrix U during the first iteration, like this

    for k in range(0, window):
        idx_range = np.minimum(n_times - 1,
                               np.arange(k, n_times + k - 2, window))
        if k == 0:
             U = np.zeros([data[idx_range].shape[0], n_ch**2])

        U = U + np.reshape(data[idx_range].reshape([-1, 1, n_ch])*data[idx_range].reshape(-1, n_ch, 1), U.shape)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions