Lesson 4 review

@shwars there are some comments in the jupyter notebooks that aren't in english.
This commit is contained in:
Lateefah Bello 2022-04-27 15:06:34 +01:00
parent a4adc3efea
commit 8917f66236
4 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ Using the code we have developed in this lesson for binary classification of MNI
1. For each digit, create a dataset for binary classifier of "this digit vs. all other digits"
1. Train 10 different perceptrons for binary classification (one for each digit)
1. Define a function that will classify an input digit
1. Define a function that will classify an input digit
> **Hint**: If we combine weights of all 10 perceptrons into one matrix, we should be able to apply all 10 perceptrons to the input digits by one matrix multiplication. Most probable digit can then be found just by applying `argmax` operation on the output.

View File

@ -708,7 +708,7 @@
"source": [
"To compute $\\partial\\mathcal{L}/\\partial W$ we can use the **chaining rule** for computing derivatives of a composite function, as you can see in the formulae above. It corresponds to the following idea:\n",
"\n",
"* Suppose under given input we have obtanes loss $\\Delta\\mathcal{L}$\n",
"* Suppose under given input we have obtained loss $\\Delta\\mathcal{L}$\n",
"* To minimize it, we would have to adjust softmax output $p$ by value $\\Delta p = (\\partial\\mathcal{L}/\\partial p)\\Delta\\mathcal{L}$ \n",
"* This corresponds to the changes to node $z$ by $\\Delta z = (\\partial\\mathcal{p}/\\partial z)\\Delta p$\n",
"* To minimize this error, we need to adjust parameters accordingly: $\\Delta W = (\\partial\\mathcal{z}/\\partial W)\\Delta z$ (and the same for $b$)\n",
@ -821,7 +821,7 @@
"source": [
"## Training the Model\n",
"\n",
"Now we are ready to write the **training loop**, which will go through our dataset, and perform the optimization minibatch by minibatch.One complete pass through the dataset is often called **an epoch**:"
"Now we are ready to write the **training loop**, which will go through our dataset, and perform the optimization minibatch by minibatch. One complete pass through the dataset is often called **an epoch**:"
]
},
{
@ -1169,7 +1169,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
" Adding several layers make sense, because unlike one-layer network, multi-layered model will be able to accuratley classify sets that are not linearly separable. I.e., a model with several layers will be **reacher**.\n",
" Adding several layers make sense, because unlike one-layer network, multi-layered model will be able to accurately classify sets that are not linearly separable. I.e., a model with several layers will be **reacher**.\n",
"\n",
"> It can be demonstrated that with sufficient number of neurons a two-layered model is capable to classifying any convex set of data points, and three-layered network can classify virtually any set.\n",
"\n",

View File

@ -17,7 +17,7 @@ Let's start with formalizing the Machine Learning problem. Suppose we have a tra
* For regression problem, when we need to predict a number, we can use **absolute error** &sum;<sub>i</sub>|f(x<sup>(i)</sup>)-y<sup>(i)</sup>|, or **squared error** &sum;<sub>i</sub>(f(x<sup>(i)</sup>)-y<sup>(i)</sup>)<sup>2</sup>
* For classification, we use **0-1 loss** (which is essentially the same as **accuracy** of the model), or **logistic loss**.
For one-level perceptron, function *f* was defined as a linear function *f(x)=wx+b* (here *w* is the weight matrix, *x* is the vector if input features, and *b* is bias vector). For different neural network architectures, this function can take more complex form.
For one-level perceptron, function *f* was defined as a linear function *f(x)=wx+b* (here *w* is the weight matrix, *x* is the vector of input features, and *b* is bias vector). For different neural network architectures, this function can take more complex form.
> In the case of classification, it is often desirable to get probabilities of corresponding classes as network output. To convert arbitrary numbers to probabilities (eg. to normalize the output), we often use **softmax** function &sigma;, and the function *f* becomes *f(x)=&sigma;(wx+b)*
@ -56,6 +56,7 @@ Note that the left-most part of all those expressions is the same, and thus we c
<img src="images/ComputeGraphGrad.PNG" width="400px" align="right"/>
We will cover back prop in much more detail in our notebook example.
## [Proceed to Notebook](OwnFramework.ipynb)
In the accompanying notebook, we will implement our own framework for building and training multi-layered perceptrons. You will be able to see in detail how modern neural networks operate. Proceed to [OwnFramework](OwnFramework.ipynb) notebook.

View File

@ -6,7 +6,6 @@ Lab Assignment from [AI for Beginners Curriculum](https://github.com/microsoft/a
Solve the MNIST handwritten digit classification problem using 1-, 2- and 3-layered perceptron. Use the neural network framework we have developed in the lesson.
## Stating Notebook
Start the lab by opening [MyFW_MNIST.ipynb](MyFW_MNIST.ipynb)