audiossl icon indicating copy to clipboard operation
audiossl copied to clipboard

Extracting embeddings.

Open Sreeni1204 opened this issue 2 years ago • 2 comments

Hello,

Could you please provide me information on how to extract embeddings from the model?

I am working with VoxCeleb2 audio data. I am training the model from scratch and would like to extract embeddings for further processing.

Please do let me know.

Regards, Sreeni...

Sreeni1204 avatar Sep 01 '22 12:09 Sreeni1204

Hi,@Sreeni1204. Thanks for you insterest in our work!

For extracting embedding, please see example in "/audiossl/methods/atst/downstream/train_freeze.py".

pretrained_encoder = get_pretraied_encoder(args)

pretrained_module = PretrainedEncoderPLModule(pretrained_encoder,
                                                    6.,
                                                    args.n_last_blocks)
embedding = pretrained_module(input)

You may also want see extract_embedding function(also in train_freeze.py), which show how to extract all embeddings from a dataloader.

Hope this helps. If you have any further questions, please let me know.

lmaxwell avatar Sep 02 '22 05:09 lmaxwell

Hello @lmaxwell thank you for the clarifications. I will go through the file, and consult you for further clarifications.

Thank you :)

Sreeni1204 avatar Sep 06 '22 14:09 Sreeni1204