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

feature(whl): add demo code for lstm and gtrxl #45

Merged
merged 3 commits into from
Mar 5, 2023

Conversation

kxzxvbk
Copy link
Contributor

@kxzxvbk kxzxvbk commented Feb 20, 2023

No description provided.

chapter5_time/gtrxl.py Outdated Show resolved Hide resolved
chapter5_time/gtrxl.py Show resolved Hide resolved
chapter5_time/gtrxl.py Show resolved Hide resolved
chapter5_time/gtrxl.py Outdated Show resolved Hide resolved
chapter5_time/lstm.py Show resolved Hide resolved
chapter5_time/lstm.py Outdated Show resolved Hide resolved
chapter5_time/lstm.py Outdated Show resolved Hide resolved
chapter5_time/gtrxl.py Outdated Show resolved Hide resolved
chapter5_time/lstm.py Show resolved Hide resolved
chapter5_time/lstm.py Show resolved Hide resolved
chapter5_time/gtrxl.py Outdated Show resolved Hide resolved
pos_embedding = self.pos_embedding_dict[cur_seq]
# Otherwise, create a new position encoding and store it into self.pos_embedding_dict.
else:
pos_ips = torch.arange(full_seq - 1, -1, -1.0, dtype=torch.float) # full_seq
Copy link
Contributor

Choose a reason for hiding this comment

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

为什么我们transformer的实现里面没有pos_embedding,以及这里为什么设计为 [full_seq, -1] ?

@PaParaZz1 PaParaZz1 merged commit c609bf7 into opendilab:main Mar 5, 2023
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.

None yet

3 participants