I want to know how to get the gradient of the model and data？
let’s give an example:
We input a wave into the model ( code: [ EncoderClassifier.classify_batch(wav_signal) ])
after that, we can get output_probs,score,index,text_lab
but, how to get wav_signal.grad and the model.grad?
@Gastron may be of help here.
There is a default in the Pretrained class:
freeze_params=True. This sets requires_grad=False on the model parameters. You should probably pass
freeze_params=False when constructing the instance. The feature extraction modules used to have
torch.no_grad in their forward methods, but we very recently merged a change in the develop branch of SpeechBrain. This change has not propagated to the PyPi version yet, so you should install via git clone for this: Quick installation — SpeechBrain 0.5.0 documentation