logistic regression with a neural network mindset python example

Solutions on MaxInterview for logistic regression with a neural network mindset python example by the best coders in the world

showing results for - "logistic regression with a neural network mindset python example"
Maryjane
23 Feb 2019
1y = [1], it's a 'cat' picture.
2
Hailey
16 Mar 2018
1import numpy as np
2import matplotlib.pyplot as plt
3import h5py
4import scipy
5from PIL import Image
6from scipy import ndimage
7
8%matplotlib inline
9
Neal
19 Jan 2019
1train_set_x = train_set_x_flatten/255.
2test_set_x = test_set_x_flatten/255.
3
Riccardo
19 Aug 2019
1# Loading the data (cat/non-cat)
2train_set_x_orig, train_set_y, test_set_x_orig, test_set_y, classes = load_dataset()
3
Pedro
19 Mar 2020
1sigmoid([0, 2]) = [ 0.5         0.88079708]
2
Tylan
24 Apr 2018
1- m_train (number of training examples)
2- m_test (number of test examples)
3- num_px (= height = width of a training image)
4
Erika
20 Jul 2019
1X_flatten = X.reshape(X.shape[0], -1).T      # X.T is the transpose of X
2
Lela
20 Oct 2019
1def load_dataset():
2    train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
3    train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
4    train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
5
6    test_dataset = h5py.File('datasets/test_catvnoncat.h5', "r")
7    test_set_x_orig = np.array(test_dataset["test_set_x"][:]) # your test set features
8    test_set_y_orig = np.array(test_dataset["test_set_y"][:]) # your test set labels
9
10    classes = np.array(test_dataset["list_classes"][:]) # the list of classes
11    
12    train_set_y_orig = train_set_y_orig.reshape((1, train_set_y_orig.shape[0]))
13    test_set_y_orig = test_set_y_orig.reshape((1, test_set_y_orig.shape[0]))
14    
15    return train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes
16
Alexa
02 Jul 2017
1- Initialize the parameters of the model
2- Learn the parameters for the model by minimizing the cost  
3- Use the learned parameters to make predictions (on the test set)
4- Analyse the results and conclude
Aymane
08 Jul 2018
1train_set_x_flatten shape: (12288, 209)
2train_set_y shape: (1, 209)
3test_set_x_flatten shape: (12288, 50)
4test_set_y shape: (1, 50)
5sanity check after reshaping: [17 31 56 22 33]
6