Gradient Reversal Layer in Kaldi

226 views
Skip to first unread message

Rupam Ojha

unread,
Mar 4, 2019, 6:07:49 AM3/4/19
to kaldi-help

I would like to do something similar to what is suggested in the DANN paper for speech recognition.
Similar things have been tried in speech as suggested in these paper1, paper2 etc.

For this I want to make a neural network where I can multiply the value of the gradient by -1 or somehow reverse the direction of gradient for adversarial training. How to do something like this in kaldi ?

For now what I am doing is building GMM-HMM models in kaldi for obtaining the pdf-ids and build the graphs. Then I am training the neural network(similar to DANN mentioned above) on some open source software to obtain the posterior probabilities. Then using those posterior probabilities obtained from the NN to build the lattices and do the scoring part in kaldi.

If I could build the NN in kaldi itself, it would be much easier to perform experiments.

Daniel Povey

unread,
Mar 4, 2019, 3:21:36 PM3/4/19
to kaldi-help
I think it is possible in nnet3 with a NoOpComponent with backprop-scale=-1.
But I don't think you are likely to get very good results, and also having the extra output node would require some C++ programming and some understanding of the framework.  I suggest not to try; I don't think you will be able to do it.

Dan

--
Go to http://kaldi-asr.org/forums.html find out how to join
---
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
To post to this group, send email to kaldi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaldi-help/d77db058-b05d-4fb4-ba4b-7bbbf09a0b94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rupam Ojha

unread,
Mar 5, 2019, 4:41:37 AM3/5/19
to kaldi-help
Thank you Dan

Guiming Mo

unread,
May 28, 2019, 3:39:12 AM5/28/19
to kaldi-help
Hi Dan
  Recently, I am also engaged in domain-adaptation related tasks. What advice do you have for this direction?

在 2019年3月5日星期二 UTC+8上午4:21:36,Dan Povey写道:
I think it is possible in nnet3 with a NoOpComponent with backprop-scale=-1.
But I don't think you are likely to get very good results, and also having the extra output node would require some C++ programming and some understanding of the framework.  I suggest not to try; I don't think you will be able to do it.

Dan

On Mon, Mar 4, 2019 at 6:07 AM Rupam Ojha <findru...@gmail.com> wrote:

I would like to do something similar to what is suggested in the DANN paper for speech recognition.
Similar things have been tried in speech as suggested in these paper1, paper2 etc.

For this I want to make a neural network where I can multiply the value of the gradient by -1 or somehow reverse the direction of gradient for adversarial training. How to do something like this in kaldi ?

For now what I am doing is building GMM-HMM models in kaldi for obtaining the pdf-ids and build the graphs. Then I am training the neural network(similar to DANN mentioned above) on some open source software to obtain the posterior probabilities. Then using those posterior probabilities obtained from the NN to build the lattices and do the scoring part in kaldi.

If I could build the NN in kaldi itself, it would be much easier to perform experiments.

--
Go to http://kaldi-asr.org/forums.html find out how to join
---
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi...@googlegroups.com.

Daniel Povey

unread,
May 28, 2019, 12:26:14 PM5/28/19
to kaldi-help, Vimal Manohar
Vial (cc'd) may be able to point you to some existing scripts.
I would probably try to solve this with a similar setup to multiingual training, or by just
merging the data together (possibly doing speed perturbation on the in-domain data but
not the out-of-domain data).
Work is currently ongoing on a new version of the nnet3/chain training scripts that would
make that kind of thing easier to do. 
I don't recall where our current multilingual example scripts are; Vimal might know.

Dan


To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.

To post to this group, send email to kaldi...@googlegroups.com.

Vimal Manohar

unread,
May 28, 2019, 9:56:31 PM5/28/19
to kaldi-help
If you want to adapt a model, you can use the approach in egs/rm/s5/local/chain/tuning/run_tdnn_wsj_rm_1c.sh 

There is separate semisupervised recipe in egs/fisher_english/s5/local/semisup/chain/tuning/run_tdnn_100k_semisupervised_1a.sh.

To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.

To post to this group, send email to kaldi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages