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 11 months ago

dmarx commented 11 months 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 11 months 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 11 months 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