Perceptron

Perceptron là một Neuron nhân tạo

Nó là mạng thần kinh đơn giản nhất có thể

Mạng thần kinh là nền tảng của Trí tuệ nhân tạo .

Frank Rosenblatt

Frank Rosenblatt (1928 - 1971) là nhà tâm lý học người Mỹ nổi tiếng trong lĩnh vực Trí tuệ nhân tạo.

Năm 1957 , ông bắt đầu một cái gì đó thực sự lớn.

Các nhà khoa học đã phát hiện ra rằng các tế bào não (Tế bào thần kinh ) nhận đầu vào từ các giác quan của chúng ta bằng các tín hiệu điện.

Sau đó, các tế bào thần kinh lại sử dụng các tín hiệu điện để lưu trữ thông tin và đưa ra quyết định dựa trên đầu vào trước đó.

Frank có ý tưởng rằng Tế bào thần kinh nhân tạo có thể mô phỏng các nguyên tắc của não, với khả năng học hỏi và đưa ra quyết định.

Từ những suy nghĩ đó, ông đã “phát minh” ra Perceptron .

Perceptron đã được thử nghiệm trên máy tính IBM 704 tại Phòng thí nghiệm Hàng không Cornell vào năm 1957.


Perceptron

Perceptron ban đầu được thiết kế để lấy một số đầu vào nhị phân và tạo ra một đầu ra nhị phân (0 hoặc 1).

Ý tưởng là sử dụng các trọng số khác nhau để thể hiện tầm quan trọng của mỗi đầu vào và tổng các giá trị phải lớn hơn giá trị ngưỡng trước khi đưa ra quyết định như đúng hay sai (0 hoặc 1).

Perceptron


Ví dụ Perceptron

Hãy tưởng tượng một perceptron (trong não của bạn).

Perceptron cố gắng quyết định xem bạn có nên đi xem một buổi hòa nhạc hay không.

Is the artist good? Is the weather good?

What weights should these facts have?

CriteriaInputWeight
Artists is Goodx1 = 0 or 1w1 = 0.7
Weather is Goodx2 = 0 or 1w2 = 0.6
Friend Will Comex3 = 0 or 1w3 = 0.5
Food is Servedx4 = 0 or 1w4 = 0.3
Alcohol is Servedx5 = 0 or 1w5 = 0.4

The Perceptron Algorithm

Frank Rosenblatt suggested this algorithm:

  1. Set a threshold value
  2. Multiply all inputs with its weights
  3. Sum all the results
  4. Activate the output

1. Set a threshold value:

  • Threshold = 1.5

2. Multiply all inputs with its weights:

  • x1 * w1 = 1 * 0.7 = 0.7
  • x2 * w2 = 0 * 0.6 = 0
  • x3 * w3 = 1 * 0.5 = 0.5
  • x4 * w4 = 0 * 0.3 = 0
  • x5 * w5 = 1 * 0.4 = 0.4

3. Sum all the results:

  • 0.7 + 0 + 0.5 + 0 + 0.4 = 1.6 (The Weighted Sum)

4. Activate the Output:

  • Return true if the sum > 1.5 ("Yes I will go to the Concert")

If the treshold value is 1.5 for you, it might be different for someone else.

Example

const treshold = 1.5;
const inputs = [1, 0, 1, 0, 1];
const weights = [0.7, 0.6, 0.5, 0.3, 0.4];

let sum = 0;
for (let i = 0; i < inputs.length; i++) {
  sum += inputs[i] * weights[i];
}

const activate = (sum > 1.5);


Perceptron Terminology

  • Perceptron Inputs
  • Node values
  • Node Weights
  • Activation Function

Perceptron Inputs

Perceptron inputs are called nodes.

The nodes have both a value and a weight.


Node Values

In the example above the node values are: 1, 0, 1, 0, 1


Node Weights

Weights shows the strength of each node.

In the example above the node weights are: 0.7, 0.6, 0.5, 0.3, 0.4


The Activation Function

The activation functions maps the result (the weighted sum) into a required value like 0 or 1.

The binary output (0 or 1) can be interpreted as (no or yes) or (false or true).

In the example above, the activation function is simple: (sum > 1.5)

In Neuroscience, there is a debate if single-neuron encoding or distributed encoding is most relevant for understanding how the brain functions.

It is obvious that a decision like the one above, is not made by one neuron alone.

At least there must be other neurons deciding if the artist is good, if the weather is good...

Neural Networks

The Perceptron defines the first step into Neural Networks.

The perceptron is a Single-Layer Neural Network.

The Neural Network is a Multi-Layer Perceptron.