dmarx / whats-in-a-name

[WIP] probing identity and bias in text to image models
MIT License
1 stars 1 forks source link

nearest neighbors basis! #24

Open dmarx opened 1 year ago

dmarx commented 1 year ago

grab the K nearest neighbors of some input image(s), solve for linear combination (weighted sum) approximation in the k-neighbors basis.

if multiple images provided, get k-neighbors for each. could optionally even specify weights for each provided image in computing the loss for solving the basis

dmarx commented 1 year ago

alternatively, could solve against the entire stack of names with a sparsity-enducing regularization term, like a strong L1 loss or a sparse VAE or whatever

dmarx commented 1 year ago

shit, i might even be able to just softmax the similarity scores and use that as the neighbor weights, or maybe set some threshold above which a vector gets included in the optimization