Skip to content

Fix the sinusoidal positional embedding spec and grader. - #33

Merged
Exorust merged 1 commit into
Exorust:mainfrom
goliaro:fix-sinusoidal-emb
Oct 21, 2026
Merged

Exorust merged 1 commit into
Exorust:mainfrom
goliaro:fix-sinusoidal-emb

Conversation

@goliaro

@goliaro goliaro commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The notebooks called SinusoidalPositionalEmbedding(d_model, max_seq_len), so a correct implementation printed (1, 50, 100) instead of (1, 50, 64). The test now passes (max_seq_len, d_model) and an input of shape (1, 50, 64).
  • The write-up now states the Attention Is All You Need formula: frequency index i runs over 0 … d_model/2 - 1, and dimensions 2i and 2i+1 share 1 / 10000**(2i/d_model). forward is specified to return (1, seq_len, d_model).
  • The grader checks those sine/cosine values and the forward shape. The problem is marked auto-graded, and the published hints match.

Test plan

  • check("sinusoidal-positional-embedding", SinusoidalPositionalEmbedding) passes on the solution notebook
  • An implementation that gives sine and cosine different frequencies fails the new check
  • The notebook test prints torch.Size([1, 50, 64])

@goliaro
goliaro requested a review from Exorust as a code owner October 17, 2026 22:23
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown

@goliaro is attempting to deploy a commit to the exorust's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Exorust
Exorust merged commit c0375fe into Exorust:main Oct 21, 2026
1 check failed
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