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.

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!

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_outby averaging the context embeddings, which seems totally in line with the CBOW formulation. But in theDotlayer, it usescontext_outinstead: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_outwithmean_context_outin that layer fixed a shape mismatch error in my case, and the model started training properly after that.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!