Skip to content

Commit aeeaaca

Browse files
committed
Logistic Regression with a NN mindset
cat recognition
1 parent bf8a7a1 commit aeeaaca

15 files changed

+2119
-0
lines changed

Week2/Logistic Regression with a Neural Network mindset/Logistic+Regression+with+a+Neural+Network+mindset+v3.ipynb

Lines changed: 1303 additions & 0 deletions
Large diffs are not rendered by default.

Week2/Logistic Regression with a Neural Network mindset/Logistic_Regression_NN.py

Lines changed: 797 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import numpy as np
2+
import h5py
3+
4+
5+
def load_dataset():
6+
train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
7+
train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
8+
train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
9+
10+
test_dataset = h5py.File('datasets/test_catvnoncat.h5', "r")
11+
test_set_x_orig = np.array(test_dataset["test_set_x"][:]) # your test set features
12+
test_set_y_orig = np.array(test_dataset["test_set_y"][:]) # your test set labels
13+
14+
classes = np.array(test_dataset["list_classes"][:]) # the list of classes
15+
16+
train_set_y_orig = train_set_y_orig.reshape((1, train_set_y_orig.shape[0]))
17+
test_set_y_orig = test_set_y_orig.reshape((1, test_set_y_orig.shape[0]))
18+
19+
return train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes

0 commit comments

Comments
 (0)