Skip to content

Mathur exe patch 2 #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions 1- Neural Networks and Deep Learning/Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Neural Networks and Deep Learning

- Red: V Imp
- Yellow: Theory Note
- Green: Purpose of code
- Orange: Code


This is the first course of the deep learning specialization at [Coursera](https://www.coursera.org/specializations/deep-learning) which is moderated by [DeepLearning.ai](http://deeplearning.ai/). The course is taught by Andrew Ng.

## Table of contents
Expand Down Expand Up @@ -161,9 +167,10 @@ Here are the course summary as its given on the course [link](https://www.course

- First loss function would be the square root error: `L(y',y) = 1/2 (y' - y)^2`
- But we won't use this notation because it leads us to optimization problem which is non convex, means it contains local optimum points.
- This is the function that we will use: `L(y',y) = - (y*log(y') + (1-y)*log(1-y'))`
- This is the loss function that we will use: `L(y',y) = - (y*log(y') + (1-y)*log(1-y'))`
- Here `y' = sigmoid(y)`
- To explain the last function lets see:
- if `y = 1` ==> `L(y',1) = -log(y')` ==> we want `y'` to be the largest ==> `y`' biggest value is 1
- if `y = 1` ==> `L(y',1) = -log(y')` ==> we want `y'` to be the largest ==> `y'` biggest value is 1
- if `y = 0` ==> `L(y',0) = -log(1-y')` ==> we want `1-y'` to be the largest ==> `y'` to be smaller as possible because it can only has 1 value.
- Then the Cost function will be: `J(w,b) = (1/m) * Sum(L(y'[i],y[i]))`
- The loss function computes the error for a single training example; the cost function is the average of the loss functions of the entire training set.
Expand Down Expand Up @@ -255,12 +262,12 @@ Here are the course summary as its given on the course [link](https://www.course
J = 0; dw1 = 0; dw2 =0; db = 0; # Devs.
w1 = 0; w2 = 0; b=0; # Weights
for i = 1 to m
# Forward pass
# Forward Propagation
z(i) = W1*x1(i) + W2*x2(i) + b
a(i) = Sigmoid(z(i))
J += (Y(i)*log(a(i)) + (1-Y(i))*log(1-a(i)))

# Backward pass
# Backward Propagation
dz(i) = a(i) - Y(i)
dw1 += dz(i) * x1(i)
dw2 += dz(i) * x2(i)
Expand Down Expand Up @@ -383,24 +390,25 @@ Here are the course summary as its given on the course [link](https://www.course
- `a0 = x` (the input layer)
- `a1` will represent the activation of the hidden neurons.
- `a2` will represent the output layer.
- We are talking about 2 layers NN. The input layer isn't counted.
- When we talk about 2 layers NN. The input layer isn't counted.

### Computing a Neural Network's Output

- Equations of Hidden layers:
- ![](Images/05.png)
- Here are some informations about the last image:
- `noOfHiddenNeurons = 4`
- `Nx = 3`
- `Nx = 3` number of i/p nodes w/ shape as `(Nx, 1)`
- Shapes of the variables:
- `W1` is the matrix of the first hidden layer, it has a shape of `(noOfHiddenNeurons,nx)`
- `W1` is the matrix of the first hidden layer, it has a shape of `(noOfHiddenNeurons,Nx)`
- `b1` is the matrix of the first hidden layer, it has a shape of `(noOfHiddenNeurons,1)`
- `z1` is the result of the equation `z1 = W1*X + b`, it has a shape of `(noOfHiddenNeurons,1)`
- `a1` is the result of the equation `a1 = sigmoid(z1)`, it has a shape of `(noOfHiddenNeurons,1)`
- `W2` is the matrix of the second hidden layer, it has a shape of `(1,noOfHiddenNeurons)`
- `b2` is the matrix of the second hidden layer, it has a shape of `(1,1)`
- `z2` is the result of the equation `z2 = W2*a1 + b`, it has a shape of `(1,1)`
- `a2` is the result of the equation `a2 = sigmoid(z2)`, it has a shape of `(1,1)`
> No. of rows of in `W` translates to the no. of nodes in the next layer

### Vectorizing across multiple examples

Expand Down
11 changes: 2 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ This is by far the best course series on deep learning that I've taken. Enjoy!



## Specialization Certificate

At last I've successfully completed the specialization and earned my [certificate](https://coursera.org/verify/specialization/DTTJC9Y5B8U6)!

![](Certificate.png)



## Similar Notes

- Beautifully drawn notes by Tess Ferrandez:
Expand Down Expand Up @@ -66,7 +58,8 @@ Group description:

> This group is for current, past or future students of Prof Andrew Ng's deeplearning.ai class in Coursera. The purpose is for students to get to know each other, ask questions, and share insights. However, remember the Coursera Honor Code - please do not post any solution in the forum!


## Note Taking (Highlight and stuff)
1. Highlight ``` <span style="background-color: color_name">Marked text</span> ```

## Next steps

Expand Down