Good night, i have the error : βWrong shape in the last minibatch. (12288, 18) != (12288, 20)β. The text in exercise 2 say the first min batch size if not multiple of 64 will be βπ/ππππ_πππ‘πβ_π ππ§πβ[this function is letter A ] and the final will be (πβππππ_πππ‘πβ_π ππ§πΓβπππππ_πππ‘πβ_π ππ§πβ)[this function is letter B]. My code is mini_batch_X = shuffled_X[:,A: B]. I dont understand why i am wrong.
Thanks for the help !
- coursera-platform
- dl-ai-learning-platform
Please print the number of samples m for the test case. Or you can see what it is by looking at the code: m = 148. The minibatch size is 64, so that means we will end up with two full minibatches: 2 x 64 = 128. So that leaves us with 20 samples in the last partial minibatch, right? So you need to examine your code to figure out how you end up with 18 samples in the last minibatch.
1 Like
One thing to keep in mind is that indexing in python is 0-based. The element at index 64 is the 65th entry in the array.
1 Like
I finally understand, thank you !!! Its (k+1)*mini_batch_size because she go to 128 to 148 and dont lost the last 20 samples.
1 Like