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

บ้าน 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

การจดจำรูปแบบ

Neural Networksใช้ในแอปพลิเคชันเช่นการจดจำใบหน้า

แอปพลิเคชันเหล่า นี้ใช้Pattern Recognition

การจำแนกประเภทนี้สามารถทำได้ด้วยPerceptron

การจำแนกรูปแบบ

ลองนึกภาพเส้นช่องแคบ (กราฟเชิงเส้น) ในช่องว่างที่มีจุด xy กระจัดกระจาย

คุณจะจำแนกจุดเหนือและใต้เส้นได้อย่างไร?

สามารถฝึก perceptron ให้จดจำจุดที่อยู่เหนือเส้นได้โดยไม่ต้องรู้สูตรของเส้น

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

Perceptron มักใช้เพื่อจำแนกข้อมูลออกเป็นสองส่วน

Perceptron เรียกอีกอย่างว่าตัวแยกประเภทไบนารีเชิงเส้น


วิธีการตั้งโปรแกรม Perceptron

หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับวิธีการตั้งโปรแกรม perceptron เราจะสร้างโปรแกรม JavaScript ที่ง่ายมากที่จะ:

  1. สร้างพล็อตเตอร์อย่างง่าย
  2. สร้าง 500 คะแนน xy สุ่ม
  3. แสดงจุด xy
  4. สร้างฟังก์ชันเส้น: f(x)
  5. แสดงเส้น
  6. คำนวณคำตอบที่ต้องการ
  7. Display the desired answers

Create a Simple Plotter

Use the simple plotter object described in the AI Plotter Chapter.

Example

const plotter = new XYPlotter("myCanvas");
plotter.transformXY();

const xMax = plotter.xMax;
const yMax = plotter.yMax;
const xMin = plotter.xMin;
const yMin = plotter.yMin;

Create Random X Y Points

Create as many xy points as wanted.

Let the x values be random, between 0 and maximum.

Let the y values be random, between 0 and maximum.

Display the points in the plotter:

Example

const numPoints = 500;
const xPoints = [];
const yPoints = [];
for (let i = 0; i < numPoints; i++) {
  xPoints[i] = Math.random() * xMax;
  yPoints[i] = Math.random() * yMax;
}


Create a Line Function

Display the line in the plotter:

Example

function f(x) {
  return x * 1.2 + 50;
}


Compute Desired Answers

Compute the desired answers based on the line function:

y = x * 1.2 + 50.

The desired answer is 1 if y is over the line and 0 if y is under the line.

Store the desired answers in an array (desired[]).

Example

let desired = [];
for (let i = 0; i < numPoints; i++) {
  desired[i] = 0;
  if (yPoints[i] > f(xPoints[i])) {desired[i] = 1;}
}

Display the Desired Answers

For each point, if desired[i] = 1 display a blue point, else display a black point.

Example

for (let i = 0; i < numPoints; i++) {
  let color = "blue";
  if (desired[i]) color = "black";
  plotter.plotPoint(xPoints[i], yPoints[i], color);
}


How to Train a Perceptron

In the next chapters, you will learn more about how to Train the Perceptron