Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Seq2Seq Decoder LabelScorer #51

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SimBe195
Copy link
Collaborator

This PR contains a subset of changes from #45.
These are the changes that introduce the new LabelScorer and TFLabelScorer classes and subclasses.

The code in this PR can be compiled successfully but the new label-scorers are not actually used at this stage.

@SimBe195 SimBe195 requested a review from curufinwe April 17, 2023 10:44
Remove author line.
Copy link
Contributor

@curufinwe curufinwe left a comment

Choose a reason for hiding this comment

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

Not finished yet. Only started with the LabelHistoryManager, but have to go to meeting now.

src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved
src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved
}

bool isEqualSequence(const LabelHistoryHandle lhd, const LabelHistoryHandle rhd) const {
return label_sequence_hash(lhd->labelSeq) == label_sequence_hash(rhd->labelSeq);
Copy link
Contributor

Choose a reason for hiding this comment

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

Comparing hashes for equality is not the same thing as equality. Why is it ok to only check the hashes here?

src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved
src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved
src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved
src/Nn/LabelHistoryManager.hh Outdated Show resolved Hide resolved

// Note: all history have to inherit from LabelHistoryBase
struct LabelHistoryBase {
size_t ref_count, cacheHash;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
size_t ref_count, cacheHash;
size_t refCount;
size_t cacheHash;

Copy link
Contributor

Choose a reason for hiding this comment

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

Also needs to be changed everywhere else

};

typedef LabelHistoryBase* LabelHistoryHandle;
typedef std::unordered_map<size_t, LabelHistoryHandle> HistoryCache;
Copy link
Contributor

Choose a reason for hiding this comment

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

size_t here is a manually computed hash and we never test for equality correctly. Ideally we use something like: https://github.com/rwth-i6/rasr/blob/master/src/Lm/NNHistoryManager.hh#L69 for this. And even better: refactor this class and use a common class for this.

@@ -16,12 +16,300 @@
#ifndef TF_LABEL_SCORER_HH
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be inside the Tensorflow module

SimBe195 and others added 4 commits May 5, 2023 12:06
Co-authored-by: Eugen Beck <curufinwe@users.noreply.github.com>
Co-authored-by: Eugen Beck <curufinwe@users.noreply.github.com>
Co-authored-by: Eugen Beck <curufinwe@users.noreply.github.com>
Co-authored-by: Eugen Beck <curufinwe@users.noreply.github.com>
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