Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional DPP #1

Open
superRookie007 opened this issue Jun 21, 2020 · 0 comments
Open

Conditional DPP #1

superRookie007 opened this issue Jun 21, 2020 · 0 comments

Comments

@superRookie007
Copy link

There seems to be a bug in the function sample_conditional_dpp? The problem is in the indexing?

The code below computes the kernel for the conditional sampling.

    # Calculate the kernel for the marginal
    Id = np.array([1]*L.shape[0])
    Id[set0] = 0
    Id = np.diag(Id)    
    L_compset_full = inv(Id + L)
    L_minor = inv(np.delete(np.delete(L_compset_full,tuple(set0), axis=1),tuple(set0),axis=0))
    L_compset = L_minor - np.diag([1]*L_minor.shape[0])

This uses the computed kernel to sample. However the returned indices are not relative to the original kernel anymore. The returned indices should be the indices for the subsets excluding the set already chosen.

    sample = sample_dpp(L_compset,k)
    if k==2: sample = [sample]
    return np.concatenate((set0,sample) ,axis=0)-1  # back to python indexing

Am I making a mistake here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant