Skip to content

Possible typo in CBOW model: context_out used instead of mean_context_out in Dot layer #9

Description

@curciojm

Hi Thushan, Ganegedara,

First of all, thank you for the manual and the repo — they’ve been super helpful as I learn how these models work.

While going through the CBOW implementation, I noticed what might be a small typo in the model definition. The code defines mean_context_out by averaging the context embeddings, which seems totally in line with the CBOW formulation. But in the Dot layer, it uses context_out instead:

ValueError: Arguments target and output must have the same shape. Received: target.shape=(None, 1), output.shape=(None, 2)

I’m still learning, so apologies in advance if I’m misunderstanding something — but replacing context_out with mean_context_out in that layer fixed a shape mismatch error in my case, and the model started training properly after that.

Image

Just wanted to share in case it’s useful for others or for future updates.

Best regards,
Juan Manuel Curcio

I'm really enjoying the manual — learning a lot from it!

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions