Skip to content

Conversation

@hainan-xv
Copy link
Contributor

Addressing issue #2569

if (l2_term != 0.0) {
embedding_deriv->AddToRows(l2_term, active_words, embedding_mat_);
CuMatrix<BaseFloat> l2_matrix(embedding_deriv->NumRows(),
embedding_deriv->NumCols(), kUndefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what the difference is, or why the old code was wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old code does

a subset of rows of embedding_mat_ += derivs * l2_factor

But it should be

derivs += a subset of rows of embedding_mat * l2_factor

Later derivs will be added to embeeding_mat with learning rate (and possibly momentum) which makes it different.

@danpovey
Copy link
Contributor

danpovey commented Jul 31, 2018 via email

@danpovey
Copy link
Contributor

danpovey commented Aug 2, 2018

OK, thanks. Merging.

@danpovey danpovey merged commit 04027ee into kaldi-asr:master Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants