Logistic Regression with a Neural Network mindset python example
- a training set of m_train images labeled as cat (y=1)or non-cat (y=0)- a test set of m_test images labeled as cat or non-cat
- each image is of shape (num_px, num_px,3) where 3isfor the 3 channels (RGB). Thus, each image is square (height = num_px)and(width = num_px).
Logistic Regression with a Neural Network mindset python example
Number of training examples: m_train =209
Number of testing examples: m_test =50
Height/Width of each image: num_px =64
Each image is of size:(64,64,3)
train_set_x shape:(209,64,64,3)
train_set_y shape:(1,209)
test_set_x shape:(50,64,64,3)
test_set_y shape:(1,50)
Logistic Regression with a Neural Network mindset python example
- Initialize the parameters of the model
- Learn the parameters for the model by minimizing the cost
- Use the learned parameters to make predictions (on the test set)- Analyse the results and conclude
Logistic Regression with a Neural Network mindset python example
# Example of a picture
index =25
plt.imshow(train_set_x_orig[index])print("y = "+str(train_set_y[:, index])+", it's a '"+ classes[np.squeeze(train_set_y[:, index])].decode("utf-8")+"' picture.")