Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extract hidden states of PyTorch module #606

Description

@gretatuckute

Hi,
First of all, thank you for this brilliant framework.

Is it possible to extract model representations of the pre-trained models for a given input. Say I load:

from speechbrain.pretrained import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-crdnn-rnnlm-librispeech",
											 savedir="pretrained_models/asr-crdnn-rnnlm-librispeech")
asr_model.transcribe_file('speechbrain/asr-crdnn-rnnlm-librispeech/example.wav')
asr_model.modules

Under asr_model.modules I am able to see the PyTorch modules, but I am not able to see the hidden states (similar to Huggingface model(output_hidden_states=True). Is this currently possible in Speechbrain?

Thank you,
Greta

Activity

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

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions