Course 2 Week 2 Programming Assignment random_minibatch

Any help!

Hi @Gerie_knu

Please make sure that you used the parameters that sent to you in function random_mini_batches(), and the local varaibles to make your code generalize over all test cases

Best Regards,
Abdelrahman

1 Like

Note that there are at least three different tests there: two that you can see in the notebook and one that you can’t see, but is in the file public_tests.py. Both the tests you can see have m = 148 and mini_batch_size = 64. The test you can’t see has m = 7 and mini_batch_size = 2. You pass the tests that you can see, but fail the ones you can’t see. Note that the public_tests.py test checks three things and you pass the first, but that is just a “datatype” check, so passing that doesn’t really tell you much.

You can read the other test by clicking “File → Open” and then opening the file public_tests.py.

My guess is that you are hard-coding something about the sizes in your logic, so that it happens to work when m = 148 and batch size = 64.

1 Like