Error in the mini-batch implementation

Hi,
I’m getting an error in the mini-batch implementation and I don’t see why. I have been adding some debugging to find out and I see that even when my last minibatch dimensions are correct, the test is not showing so. Why it could be? I didn’t alter the append method at the end of the function.

Here is the log:

(12288, 148)
X shape is:(12288, 148)
Y shape is:(1, 148)
final batch range: 128 : 20
shape of the 1st mini_batch_X: (12288, 64)
shape of the 2nd mini_batch_X: (12288, 64)
shape of the 3rd mini_batch_X: (12288, 0)

1 Like

Hi @Edu4rd , can you please give a bit more information. Describe which assigment and which exercise are you trying to run as well as what is the error message tha tyou get?

1 Like

Hi,
Sure. It’s the Exercise 2 - random_mini_batches Course 2 Week 2.
Now there is a mix of the standard test results with my debugging:

(12288, 148)
X shape is:(12288, 148)
Y shape is:(1, 148)
final batch range: 128 : 20
shape of the 1st mini_batch_X: (12288, 64)
shape of the 2nd mini_batch_X: (12288, 64)
shape of the 3rd mini_batch_X: (12288, 0)
shape of the 1st mini_batch_Y: (1, 64)
shape of the 2nd mini_batch_Y: (1, 64)
shape of the 3rd mini_batch_Y: (1, 0)
mini batch sanity check: [ 0.90085595 -0.7612069   0.2344157 ]
(7, 3)
X shape is:(7, 3)
Y shape is:(1, 3)
final batch range: 2 : 1
(7, 3)
X shape is:(7, 3)
Y shape is:(1, 3)
final batch range: 2 : 1
Error: Wrong shape for variable 0.
Error: Wrong shape for variable 1.
(7, 3)
X shape is:(7, 3)
Y shape is:(1, 3)
final batch range: 2 : 1
Error: Wrong output for variable in position 0.
Error: Wrong output for variable in position 1.
 1  Tests passed
 2  Tests failed

1 Like

Clean of my debugging:
image

Hey @Edu4rd,

Are you sure you are on the right forum topic? Course 2 is "Build, Train, and Deploy ML Pipelines using BERT and I can not find the Exercise you mentioned in your question.

1 Like

HI MIlos,

no. I’m in week 2 for Course 2 in the

Deep Learning Specialization: Improving Deep Neural Networks: Hyperparameter Tuning, Regularization and Optimization

I guess I got confused. Let me check and fix it as needed.

Eduard

1 Like