ปัญญาประดิษฐ์

บ้าน AI คืออะไร? ความฉลาดของมนุษย์ ประวัติศาสตร์ภาษา ประวัติของตัวเลข ประวัติคอมพิวเตอร์ หุ่นยนต์ เปลี่ยนงาน ตัวอย่างของ AI ทฤษฎีความคิด การเขียนโปรแกรม JavaScript AI ในเบราว์เซอร์

คณิตศาสตร์

คณิตศาสตร์ ฟังก์ชันเชิงเส้น พีชคณิตเชิงเส้น เวกเตอร์ เมทริกซ์ เทนเซอร์

สถิติ

ความน่าจะเป็น สถิติ การกระจาย

กราฟิก

AI Plotter AI กราฟเชิงเส้น แผน AI กระจาย

AI Science

วิทยาศาสตร์ การรวบรวมข้อมูล การจัดกลุ่ม การถดถอย การเรียนรู้ของเครื่อง โครงข่ายประสาทเทียม

การเรียนรู้ของเครื่อง

Perceptrons การยอมรับ การฝึกอบรม การทดสอบ การเรียนรู้ คำศัพท์ Brain.js

TensorFlow

TFJS กวดวิชา TFJS Operations TFJS รุ่น TFJS Viewer

ตัวอย่าง 1

Ex1 Intro ข้อมูล Ex1 รุ่น Ex1 การฝึกอบรม Ex1

ตัวอย่าง 2

บทนำ Ex2 ข้อมูล Ex2 รุ่น Ex2 การฝึกอบรม Ex2

JS กราฟิก

บทนำ กราฟแคนวาส กราฟ Plotly.js กราฟ Chart.js กราฟ Google กราฟ D3.js

Perceptrons

Perceptronเป็นเซลล์ประสาทเทียม

เป็นโครงข่ายประสาทเทียม ที่ง่ายที่สุด

โครงข่ายประสาทเทียมเป็นส่วนสำคัญของปัญญาประดิษฐ์

แฟรงค์ โรเซนแบลตต์

Frank Rosenblatt (1928 - 1971) เป็นนักจิตวิทยาชาวอเมริกันที่มีชื่อเสียงในด้านปัญญาประดิษฐ์

ในปีพ.ศ. 2500เขาเริ่มต้นสิ่งที่ยิ่งใหญ่

นักวิทยาศาสตร์ได้ค้นพบว่าเซลล์สมอง ( เซลล์ประสาท ) รับข้อมูลจากประสาทสัมผัสของเราโดยสัญญาณไฟฟ้า

จากนั้นเซลล์ประสาทจะใช้สัญญาณไฟฟ้าอีกครั้งเพื่อเก็บข้อมูล และตัดสินใจโดยอิงจากข้อมูลที่ป้อนไว้ก่อนหน้า

แฟรงค์มีความคิดว่าเซลล์ประสาทประดิษฐ์สามารถจำลองหลักการของสมองด้วยความสามารถในการเรียนรู้และตัดสินใจ

จากความคิดเหล่านี้ เขา ได้"ประดิษฐ์" Perceptron

Perceptron ได้รับการทดสอบบนคอมพิวเตอร์ IBM 704 ที่ Cornell Aeronautical Laboratory ในปี 2500


The Perceptron

Perceptronดั้งเดิมได้รับการออกแบบมาเพื่อรับอินพุตไบนารี จำนวนหนึ่ง และสร้าง เอาต์พุตไบนารี หนึ่งรายการ (0 หรือ 1)

แนวคิดคือการใช้น้ำหนัก ที่แตกต่างกัน เพื่อแสดงความสำคัญของอินพุต แต่ละ รายการ และผลรวมของค่าควรมากกว่า ค่า เกณฑ์ก่อนตัดสินใจเช่นจริงหรือเท็จ (0 หรือ 1)

เพอร์เซ็ปตรอน


ตัวอย่าง Perceptron

ลองนึกภาพผู้รับรู้ (ในสมองของคุณ)

เพอร์เซปตรอนพยายามตัดสินใจว่าคุณควรไปคอนเสิร์ตหรือไม่

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.