kitzeslab / opensoundscape

Open source, scalable software for the analysis of bioacoustic recordings
http://opensoundscape.org
MIT License
140 stars 16 forks source link

Add a generate_embeddings() method to custom CNN #1056

Closed Maxime-Bru closed 1 month ago

Maxime-Bru commented 2 months ago

I trained a custom CNN model following the tutorial (https://opensoundscape.org/en/latest/tutorials/train_cnn.html).

Now my model has a predict() method to get the prediction scores. I don't think it is yet possible to retrieve the embeddings: would it be possible to add a generate_embeddings() method to achieve this?

sammlapp commented 2 months ago

Hi @Maxime-Bru , this feature is implemented in the develop branch as CNN.embed() and will be included in the upcoming 0.11.0 release. To accomplish something similar in current/previous releases follow this example from the cookbook.

Maxime-Bru commented 2 months ago

Thank you, this works perfectly!