PyTorch for Deep Learning : Course 3, Module 3 - Error in code of Lab_2_encoder notebook

While looking at the notebook named “C3M3_Lab2_Encoder.ipynb” and I think I found a typo.

In cell 4 (class PositionalEncoding) we define “_init_” has taking (max_len, d_model), but in the next cell (cell 5) we give the variable pos_encoder the arguments in the wrong order, i.e, (d_model, max_len), which might confuse people when trying to interpret the graph that follows.

2 screenshots are attached to further help understanding the problem.

image

Thanks for reporting this, Manuel! I’ll fix this soon.