added new functions to accept NnetExample in nnet-chain-training.cc.#15
added new functions to accept NnetExample in nnet-chain-training.cc.#15
Conversation
| } | ||
| } | ||
|
|
||
| bool AddWeightToFst(const fst::StdVectorFst &normalization_fst, |
There was a problem hiding this comment.
What is this for? Can you just use the AddWeightToSupervisionFst?
There was a problem hiding this comment.
It uses fst::StdVectorFst as input, but AddWeightToSupervisionFst use Supervision object
There was a problem hiding this comment.
Ok. Modify AddWeightToSupervisionFst to call AddWeightToFst instead of duplicating the code.
There was a problem hiding this comment.
I am not sure, if Dan likes to modify original function!
It is better to keep it for now!
src/chain/chain-training.cc
Outdated
| xent_output_deriv->SetZero(); | ||
| xent_output_deriv->CopyFromMat(supervision.GetFullMatrix()); | ||
| } | ||
| int32 num_sequences = 64, |
There was a problem hiding this comment.
Obviously you should read this as parameters. But ok for now.
| } | ||
| int32 num_sequences = 64, | ||
| frames_per_sequence = 150; | ||
| BaseFloat sup_weight = 1.0; |
There was a problem hiding this comment.
This also from supervision object if it is inside that.
There was a problem hiding this comment.
There is no supervision object at this level!
src/chainbin/nnet3-chain-get-egs.cc
Outdated
| continue; | ||
| } | ||
|
|
||
| /* |
There was a problem hiding this comment.
I guess you accidentally modified this file?
src/nnet3/nnet-example-utils.cc
Outdated
| request->inputs.clear(); | ||
| request->inputs.reserve(eg.io.size()); | ||
| request->outputs.clear(); | ||
| request->outputs.reserve(eg.io.size() * 2); |
There was a problem hiding this comment.
You can do (use_xent_regularization? 2: 1)
src/nnet3/nnet-example-utils.cc
Outdated
| bool store_component_stats, | ||
| bool use_xent_regularization, | ||
| bool use_xent_derivative, | ||
| ComputationRequest *request) { |
There was a problem hiding this comment.
Perhaps you can combine with the previous function and give the two new arguments at the end with the default as false.
|
You don't seem to have change nnet3-merge-egs, which is required since the ordering of n and t indexes is different for chain. |
|
|
||
| BINFILES = chain-est-phone-lm chain-get-supervision chain-make-den-fst \ | ||
| nnet3-chain-get-egs nnet3-chain-copy-egs nnet3-chain-merge-egs \ | ||
| nnet3-chain-get-egs nnet3-chain-get-egs-post nnet3-chain-copy-egs nnet3-chain-merge-egs \ |
There was a problem hiding this comment.
You forgot to add nnet3-chain-get-egs-post
| // to weights used to combine lm weight | ||
| // with acoustic weight in sup_lat | ||
| if (normalization_fst.NumStates() > 0 && | ||
| !chain::AddWeightToFst(normalization_fst, &sup_fst)) { |
There was a problem hiding this comment.
This should be scaled_normalization_fst
| fst::StdVectorFst sup_fst, | ||
| scaled_normalization_fst(normalization_fst); | ||
| ConvertLatticeToPdfLabels(tmodel, lat, &sup_fst); | ||
| ScaleFst(0.5, &scaled_normalization_fst); // Scale lattice to have weights similar |
There was a problem hiding this comment.
Instead to doing this scaling for each utterance, you can do it immediately after reading the fst.
|
|
||
| BaseFloat tot_objf, tot_l2_term, tot_weight; | ||
|
|
||
| int32 num_sequences = 64, frames_per_sequence = 150; |
There was a problem hiding this comment.
This might have to be 50 i.e. after subsampling.
|
@vimalmanohar I think we can test setup (MergeIo) as what we have for now and if it gives us improvement, we can add it as separate function. |
No description provided.