I am trying to solve the programming assessment: Logistic Regression with a Neural Network Mindset from the week2 of 'Neural network & deep learning course' by Andrew NG on coursera.
This is the code:
# X.reshape(X.shape[0], -1).T
train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0], -1).T
print(train_set_x_flatten.shape)
print ("train_set_x_flatten shape: " + str(train_set_x_flatten.shape))
train_set_x_flattenExtra = train_set_x_orig.reshape(-1, train_set_x_orig.shape[0])
print ("train_set_x_flattenExtra shape: " + str(train_set_x_flattenExtra.shape))
print()
# X.reshape(-1, X.shape[0])
test_set_x_flatten = test_set_x_orig.reshape(test_set_x_orig.shape[0], -1).T
print((test_set_x_orig.reshape(-1, test_set_x_orig.shape[0])).shape)
print ("test_set_x_flatten shape: " + str(test_set_x_flatten.shape))
test_set_x_flattenExtra = test_set_x_orig.reshape(-1, test_set_x_orig.shape[0])
print(test_set_x_flattenExtra.shape)
print ("train_set_x_flattenExtra shape: " + str(train_set_x_flattenExtra.shape))
print()
As per my understanding, both should do the same thing and the output also shows the same shape, but coursera doesn't validate the X.reshape(-1, X.shape[0]) approach.
Are these two fn working different or its just coursera not validating another approach
Output: Output