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

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

วัตถุพล็อตเตอร์

การมีวัตถุพล็อตเตอร์นั้นดีเมื่อศึกษาปัญญาประดิษฐ์:

  • ทำให้ AI สนุก ขึ้น
  • ทำให้ AI มีภาพ มากขึ้น
  • ทำให้ AI เข้าใจ มากขึ้น

สร้างวัตถุพล็อตเตอร์

ตัวอย่าง

function XYPlotter(id) {

this.canvas = document.getElementById(id);
this.ctx = this.canvas.getContext("2d");
this.xMin = 0;
this.yMin = 0;
this.xMax = this.canvas.width;
this.yMax = this.canvas.height;
.
.

เพิ่มวิธีการพล็อตเส้น

ตัวอย่าง

this.plotLine = function(x0, y0, x, y, color) {
  this.ctx.moveTo(x0, y0);
  this.ctx.lineTo(x, y);
  this.ctx.strokeStyle = color;
  this.ctx.stroke();
}


เพิ่มวิธีการแปลงค่า XY

ตัวอย่าง

this.transformXY = function() {
  this.ctx.transform(1, 0, 0, -1, 0, this.canvas.height)
}


เพิ่มวิธีการพล็อตจุด

ตัวอย่าง

this.plotPoints = function(n, xArr, yArr, color, radius = 3) {
  for (let i = 0; i < n; i++) {
    this.ctx.fillStyle = color;
    this.ctx.beginPath();
    this.ctx.ellipse(xArr[i], yArr[i], radius, radius, 0, 0, Math.PI * 2);
    this.ctx.fill();
  }
}

พล็อตบางจุดสุ่ม

ตัวอย่าง

// Create a Plotter
let myPlotter = new XYPlotter("myCanvas");

// Create random XY Points
numPoints = 500;
const xPoints = Array(numPoints).fill(0).map(function(){return Math.random() * myPlotter.xMax});
const yPoints = Array(numPoints).fill(0).map(function(){return Math.random() * myPlotter.yMax});

// Plot the Points
myPlotter.plotPoints(numPoints, xPoints, yPoints, "blue");


ใส่รหัสในห้องสมุด

รหัสแหล่งที่มา

function XYPlotter(id) {

this.canvas = document.getElementById(id);
this.ctx = this.canvas.getContext("2d");
this.xMin = 0;
this.yMin = 0;
this.xMax = this.canvas.width;
this.yMax = this.canvas.height;

// Plot Line Function
this.plotLine = function(x0, y0, x, y, color) {
  this.ctx.moveTo(x0, y0);
  this.ctx.lineTo(x, y);
  this.ctx.strokeStyle = color;
  this.ctx.stroke();
}

// Transform XY Function
this.transformXY = function() {
  this.ctx.transform(1, 0, 0, -1, 0, this.canvas.height)
}

// Pot Points Function
this.plotPoints = function(n, xArr, yArr, color, radius = 3) {
  for (let i = 0; i < n; i++) {
    this.ctx.fillStyle = color;
    this.ctx.beginPath();
    this.ctx.ellipse(xArr[i], yArr[i], radius, radius, 0, 0, Math.PI * 2);
    this.ctx.fill();
  }
}

} // End Plotter Object

บันทึกเป็นไฟล์ (เช่น "myplotlib.js")

ใช้ในหน้า HTML ของคุณ

ตอนนี้คุณสามารถเพิ่มวัตถุพล็อตของคุณไปยังหน้า HTML ของคุณ:

ตัวอย่าง

<script src="myplotlib.js"></script>