Wednesday, June 28, 2017

Simple guide to Neural Network

What is Neural network?

Neural network is an algorithm which make input go through at least one hidden and output layers to output.
Graphically it is like below.





How it works?

To understand how neural network works, let’s just think about very simple model like this.



On this structure
Input: [1, 3] :
Weight: [3, 1] :

Let’s focus on .



The input go through the function .
The purpose of training on neural network is to fix the weights .
By choosing the function , you can do regression and classification.
The function is called activation function.

Follow the calculation

To understand better, here, I follow the calculations.




The weights are assigned on all arrows, meaning by training you the model fixes the all arrow’s values.
By matrix expression, all the calculation can be simply expressed.

Under the condition of the parameters above, I just follow the calculation and express the output by those.



plot_1’s A and B are like above.



The output of is .
I take for this. So, the input of can be expressed as .



I take for .

So, we can express the input of layer as below.




The output of layer is the value that the input goes through the activation function .

Fix parameters

Getting parameters is as following.
  • define loss function and find parameters which minimize that(to say precisely, not minimize)
example




In this case, the local minimum is the local optimal solution. It means the parameter is .
But actually, neural network has so many parameters and the functions are nested. So it’s not easy to optimize.
The fundamental way to get parameters is to give initial values to parameters and by training update those.
On the example
  • : the parameter
  • : loss function
The goal is to get parameter which locally minimizes .
Procedure
  1. give initial values to parameter. This time give 0 to .
  2. update parameter

how to update parameter

move to or to