It's because we have 20000 training samples and 2500 validation and test samples. Previously there was no error since these numbers are divisible by 50, which is the original batch_size in the solution notebook. Still, when someone wants to experiment with other batch sizes that are not divisible, they will encounter the mentioned error. So I added drop_last to the notebook so students can experiment with other batch sizes and will not be surprised due to this error.
When I tried to change the batch_size in the notebook from 50 to 64, I encountered the following error:
RuntimeError: Expected hidden[0] size (2, 4, 256), got (2, 64, 256)
It's because we have
20000
training samples and2500
validation and test samples. Previously there was no error since these numbers are divisible by 50, which is the original batch_size in the solution notebook. Still, when someone wants to experiment with other batch sizes that are not divisible, they will encounter the mentioned error. So I addeddrop_last
to the notebook so students can experiment with other batch sizes and will not be surprised due to this error.