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

Aggregate functions for vectors #51

Closed
mmcauliffe opened this issue Dec 29, 2022 · 4 comments
Closed

Aggregate functions for vectors #51

mmcauliffe opened this issue Dec 29, 2022 · 4 comments

Comments

@mmcauliffe
Copy link

I'm trying to generate means of vectors, but I'm getting the error message ERROR: function avg(vector) does not exist. Is this something that's easy to implement in pgvector, or should I rely on code outside the database for aggregation?

@ankane
Copy link
Member

ankane commented Dec 29, 2022

Hi @mmcauliffe, you'll currently need to rely on outside code. Can you share more about the use case?

@ankane
Copy link
Member

ankane commented Dec 29, 2022

Previous discussion: #13

@mmcauliffe
Copy link
Author

So I'm working with ivectors for speaker recognition with databases of speech corpora, The database has a table for utterances with audio data, along with a table of speakers of those utterances. Ivectors are calculated initially over utterances, and then the ivector for a speaker is the mean of the utterance ivectors. In the application, I'm using for running classification of "did this speaker actually speak this utterance?" and comparing between speakers for "is the metadata wrong and these should actually be treated as the same speaker" to clean up the speech corpus with better metadata.

Not too huge of a deal to do a query, aggregate, and update, but it'd be nice to have the speaker ivector be a function of the utterance ivectors inside the database so that speakers get updated more automatically.

@ankane ankane closed this as completed in e09f93c Dec 31, 2022
@ankane
Copy link
Member

ankane commented Dec 31, 2022

Thanks for the context. Added in the commit above (and will be released with 0.4.0, likely sometime in January).

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

No branches or pull requests

2 participants