Keep a record of your learning to become a machine learning engineer. I will write it constantly.
This time, I will explain the perceptron and neural network that are the basis of deep learning.
This article is a memo that I have learned while reading "Deep Learning from Zero" (Author: Mr. Yasuki Saito). Please do not take the content and read it as a reference until you get tired of it. (Points and questions are welcome, but only in gentle words.) Link: Deep Learning from scratch
・ What is Perceptron? ・ What is a neural network?
It is an algorithm that returns one output for multiple inputs. It's like AND / OR / NAND in logic circuits. Deep learning, which is also a neural network, is based on this algorithm.
#Write an AND circuit with 2 inputs with a perceptron
def AND(x1,x2,bias=0.5):
tmp = w1*x1 +w2*x2 - bias
if tmp <= 0:
return 0
elif tmp > 0:
return 1
The variables that affect the output are the input value, weight, and bias. These are called parameters. The neural network adjusts the parameters and trains them.
Looking at the figure, it looks like a multi-layer perceptron. However, there is a big difference from Perceptron.
The total of the input signals (input value, bias, weight) changes with the threshold value as the boundary. (set a fire) Perceptron also has an activation function that does not change anything, In neural networks, the type of activation function changes depending on the classification problem and regression problem.
By having an activation function, more various values can be output. In addition to adjusting the input value, weight, and bias, the output value can be changed by changing the function.
Whether it's a classification problem or a regression problem, the purpose of machine learning is to improve accuracy. Therefore, it is necessary to find the optimum value for the parameter while adjusting the weight and bias. The fine-tuning cannot be solved by linear functions. (Because changing the value a little will make a big difference) It can be solved by using a non-linear function.
Recommended Posts