1.2 What is a Neural Network?
An Example
Housing Price Prediction
Size (
ReLU function (rectified linear unit): “rectified” here means taking the maximum of zero and the input.
This is a small neural network.
Adding Other Features
Like bedrooms, zip code (postal code, maybe as a feature that tells you about walkability), and wealth.
Then you have a neural network with 4 inputs, including size.
These circles in the hidden layer are called hidden units in a neural network.
2.1 Binary Classification & Notation Convention
How your computer stores an image:

It stores 3 separate matrices: red, green, and blue.
For a
A single training example is represented by a pair
Your training set will comprise
Stack the training examples as columns:


2.2 Logistic Regression
Here,
2.3 Logistic Regression: Loss Function
Loss is for a single example; cost is the average loss over the training set.
- If
: ; we want large. - If
: ; we want small.

2.4 Gradient Descent
Repeat the updates to minimize

2.9 Gradient Descent in Logistic Regression
For a single example, with
Here,

2.10 Logistic Regression on Examples
Average the gradients over all
Then update

2.11 Vectorization
What Is Vectorization?
In
Maybe they're very large vectors if you have a lot of features.
Using a for loop over
A non-vectorized example for calculating

Instead, use (with w and x stored as one-dimensional NumPy arrays):
z = np.dot(w, x) + b
This means (n_x, 1), use w.T @ x + b.