dpp
dpp copied to clipboard
Conditional DPP
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?