Skip to content

added new functions to accept NnetExample in nnet-chain-training.cc.#15

Open
pegahgh wants to merge 6 commits intomasterfrom
chain-ts-learning
Open

added new functions to accept NnetExample in nnet-chain-training.cc.#15
pegahgh wants to merge 6 commits intomasterfrom
chain-ts-learning

Conversation

@pegahgh
Copy link
Copy Markdown
Owner

@pegahgh pegahgh commented Feb 13, 2018

No description provided.

}
}

bool AddWeightToFst(const fst::StdVectorFst &normalization_fst,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? Can you just use the AddWeightToSupervisionFst?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses fst::StdVectorFst as input, but AddWeightToSupervisionFst use Supervision object

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Modify AddWeightToSupervisionFst to call AddWeightToFst instead of duplicating the code.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, if Dan likes to modify original function!
It is better to keep it for now!

Comment thread src/chain/chain-training.cc Outdated
xent_output_deriv->SetZero();
xent_output_deriv->CopyFromMat(supervision.GetFullMatrix());
}
int32 num_sequences = 64,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously you should read this as parameters. But ok for now.

}
int32 num_sequences = 64,
frames_per_sequence = 150;
BaseFloat sup_weight = 1.0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also from supervision object if it is inside that.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no supervision object at this level!

Comment thread src/chainbin/nnet3-chain-get-egs.cc Outdated
continue;
}

/*
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you accidentally modified this file?

Comment thread 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do (use_xent_regularization? 2: 1)

Comment thread src/nnet3/nnet-example-utils.cc Outdated
bool store_component_stats,
bool use_xent_regularization,
bool use_xent_derivative,
ComputationRequest *request) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can combine with the previous function and give the two new arguments at the end with the default as false.

@vimalmanohar
Copy link
Copy Markdown

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.

Comment thread src/chainbin/Makefile

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 \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might have to be 50 i.e. after subsampling.

@pegahgh
Copy link
Copy Markdown
Owner Author

pegahgh commented Feb 27, 2018

@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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants