Confused about the datasets in assignments

Hey guys, I’m currently working through the second programming assignment of the course (at the end of week 3), and I’m kinda confused about which datasets I’m using in each part of the code.

For example, in week 3’s assignment we start using the flower dataset, and then go on towards building the shallow neural network model from scratch.

At the first step we need to compute the sizes of the input and output layer, and by looking at the flower dataset I know the input size of the model must be 2, right? (because there are two features, x and y, for each point of our dataset. But after computing the sizes using the variables X and Y provided with the code, I found out that the input size is 5 for some reason? Are we still using the flower dataset for the whole assignment? or was that for the introduction and we’re using a different one now? Because I don’t recall seeing a size 5 in the flower dataset.

I had the same issue with the lineal regression assignment, when we started building the model the sizes of the dataset started to change and that was confusing but I decided to just roll with it. :grimacing:

Hi @rsuriano, the input size 5 you are referring is related to the layer_sizes_test_case() whose input and output are not related to the flower dataset. You can check in public_tests.py that the function starts as follows:

def layer_sizes_test(target):
    np.random.seed(1)
    X = np.random.randn(5, 3)
    Y = np.random.randn(2, 3)
    expected_output = (5, 4, 2)

The function uses synthtetic input with predefined expect outputs i.e. it is normal it doesn’t match with the flower dataset ones.

2 Likes

Exactly. Everything we are writing here is supposed to be “general” in the sense it works with any dimensions. The test cases don’t all have to use the same dimensions as the particular “real data” that we are using here. In fact they specifically don’t match to check that you have not “hardcoded” things unnecessarily.

2 Likes

Thank you Alberto and Paulin, I thought it could be some other set but couldn’t find the code for it. I’ll check the public_test script next time!