Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Conversation

@aasseman
Copy link
Contributor

Needed for the attention decoder, as it uses a FC layer that depends on the encoded sequence length.


# Create the returned dict.
data_dict.extend({self.key_outputs: outputs_list})

Copy link
Contributor

@tkornuta-ibm tkornuta-ibm Apr 26, 2019

Choose a reason for hiding this comment

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

I guess that function should be removed as it is already in utils/word_mappings.py

Copy link
Contributor

@tkornuta-ibm tkornuta-ibm left a comment

Choose a reason for hiding this comment

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

  1. remove pad_list from sentence_embeddings
  2. rename the function to pad_truncate_list


logger.info("Saved mappings of size {} to file '{}'".format(len(word_to_ix), file_path))

def pad_list(l: list, length: int, value = 0):
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. maybe the name should be pad_truncate_list, that will reflect more its behavior?

  2. not sure whether word_mappings.py is the right place... but please leave it here for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah since the function is used both in SentenceEmbeddings and SentenceIndexer, I though that it should be somewhere in a "utils" collection of static functions.

@aasseman aasseman requested a review from tkornuta-ibm April 26, 2019 16:51
@tkornuta-ibm tkornuta-ibm merged commit 7c97fe2 into IBM:develop Apr 26, 2019
tkornuta-ibm added a commit that referenced this pull request Apr 27, 2019
(Depends on PR #18 #17) RNN Decoder with attention
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants