ข้อมูลเชิงหมวดหมู่: แสดงการออกกำลังกายแบบข้ามกลุ่ม
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Playground เป็น
แอปพลิเคชันแบบอินเทอร์แอกทีฟที่ให้คุณจัดการ
ในการฝึกอบรมและทดสอบโมเดลแมชชีนเลิร์นนิง
เพลย์กราวด์ช่วยให้คุณเลือกฟีเจอร์และปรับไฮเปอร์พารามิเตอร์ได้ แล้วดูว่าตัวเลือกของคุณส่งผลต่อโมเดลอย่างไร
หน้านี้มีแบบฝึกหัด Playground 2 ข้อ
แบบฝึกหัด 1: ไม้กางเขนแบบพื้นฐาน
สําหรับแบบฝึกหัดนี้ ให้มุ่งเน้นที่ส่วนต่อไปนี้ของอินเทอร์เฟซผู้ใช้ใน Playground
- ในส่วน "ฟีเจอร์" ให้สังเกตฟีเจอร์ของโมเดลที่เป็นไปได้ 3 รายการต่อไปนี้
- ใต้ OUTPUT คุณจะเห็นสี่เหลี่ยมจัตุรัสที่มีสีส้ม
และจุดสีน้ำเงิน ลองจินตนาการว่าคุณกำลังมองดูป่ารูปสี่เหลี่ยม
จุดสีส้มแสดงถึงตำแหน่งของต้นไม้ที่ป่วย และจุดสีน้ำเงินแสดงถึง
ตำแหน่งของต้นไม้ที่แข็งแรง
- ระหว่างคุณลักษณะและ OUTPUT ถ้ามองให้ไกล คุณจะเห็น
เส้นประสีจางๆ ที่เชื่อมต่อแต่ละฟีเจอร์กับเอาต์พุต
ความกว้างของเส้นประแต่ละเส้นแสดงถึงน้ำหนักที่สัมพันธ์กับปัจจุบัน
กับแต่ละฟีเจอร์ เส้นเหล่านี้จางลงมากเพราะน้ำหนักเริ่มต้น
สำหรับแต่ละฟีเจอร์มีค่าเริ่มต้นเป็น 0 เมื่อน้ำหนักเพิ่มขึ้นหรือลดลง ดังนั้น
ความหนาของเส้นเหล่านี้
งาน 1: สำรวจ Playground โดยทําดังนี้
- คลิกเส้นเล็กๆ ที่เชื่อมต่อฟีเจอร์ x1 กับเอาต์พุต
ป๊อปอัปจะปรากฏขึ้น
- ป้อนน้ำหนัก
1.0
ในป๊อปอัป
- กด Enter
โปรดสังเกตสิ่งต่อไปนี้
- เส้นประสําหรับ x1 จะหนาขึ้นเมื่อน้ำหนักเพิ่มขึ้นจาก 0 เป็น 1.0
- พื้นหลังสีส้มและน้ำเงินจะปรากฏขึ้น
- พื้นหลังสีส้มเป็นการเดาตำแหน่งของต้นไม้ที่ป่วย
- พื้นหลังสีฟ้าคือการคาดเดาของโมเดลว่าต้นไม้ที่มีสุขภาพดีตรงไหน
โมเดลทำงานได้แย่มาก การคาดเดาของโมเดลประมาณครึ่งหนึ่งนั้นไม่ถูกต้อง
- เนื่องจากน้ำหนักของ x1 คือ 1.0 และของฟีเจอร์อื่นๆ คือ 0 โมเดลจึงจับคู่ค่าของ x1 ได้อย่างตรงที่สุด
งาน 2: เปลี่ยนน้ำหนักของฟีเจอร์ทั้ง 3 รายการหรือรายการใดรายการหนึ่งเพื่อให้โมเดล (สีพื้นหลัง) คาดการณ์ต้นไม้ที่ป่วยและต้นไม้ที่แข็งแรงได้สําเร็จ โซลูชันจะปรากฏใต้ Playground
คลิกที่นี่เพื่อดูวิธีแก้ปัญหาของงาน 2
- w1 = 0
- w2 = 0
- x1 x2 = ค่าบวกใดก็ได้
เพื่อความสนุก จะเกิดอะไรขึ้นหากคุณป้อนค่าที่เป็นค่าลบสำหรับฟีเจอร์
กากบาท
แบบฝึกหัด 2: กากบาทฟีเจอร์ที่มีความซับซ้อนมากขึ้น
สำหรับแบบฝึกหัดที่สอง ให้ดูที่การจัดเรียงจุดสีส้ม (ต้นไม้ป่วย)
และจุดสีน้ำเงิน (ต้นไม้ที่มีสุขภาพดี) ในโมเดลเอาต์พุต สังเกตเห็นสิ่งต่อไปนี้:
- จุดจะอยู่ในรูปแบบ 360 องศาคร่าวๆ
- การจัดเรียงจุดมีเสียงดัง ตัวอย่างเช่น สังเกตการณ์สีน้ำเงิน
จุดในทรงกลมด้านนอกของจุดสีส้ม ดังนั้น แม้แต่โมเดลที่ยอดเยี่ยมก็อาจคาดการณ์จุดแต่ละจุดได้อย่างไม่ถูกต้อง
งาน 1: สำรวจ UI ของ Playground โดยทําดังนี้
- คลิกปุ่มเรียกใช้/หยุดชั่วคราว ซึ่งเป็นรูปสามเหลี่ยมสีขาวภายในกรอบสีดำ
Playground จะเริ่มฝึกโมเดล สังเกตการณ์
ตัวนับ Epoch จะเพิ่มขึ้น
- หลังจากที่ระบบฝึกฝนเป็นเวลาอย่างน้อย 300 Epoch แล้ว ให้กด
ปุ่มเรียกใช้/หยุดชั่วคราวเพื่อหยุดการฝึกชั่วคราว
- ดูที่โมเดล โมเดลทำการคาดการณ์ได้ดีไหม กล่าวคือ จุดสีน้ำเงินมักจะล้อมรอบด้วยพื้นหลังสีน้ำเงิน และจุดสีส้มมักจะล้อมรอบด้วยพื้นหลังสีส้มใช่ไหม
- ตรวจสอบค่าของ Test loss ซึ่งปรากฏอยู่ใต้ OUTPUT ค่านี้อยู่ใกล้กับ 1.0 (การสูญเสียสูงกว่า) หรือใกล้กับ 0 (การสูญเสียต่ำกว่า)
- รีเซ็ต Playground โดยการกดลูกศรโค้งทางด้านซ้ายของ
ปุ่มเรียกใช้/หยุดชั่วคราว
งานที่ 2: สร้างโมเดลที่ดีขึ้นโดยดำเนินการดังนี้
- เลือกหรือยกเลิกการเลือกชุดค่าผสมของฟีเจอร์ที่เป็นไปได้ 5 แบบ
- ปรับอัตราการเรียนรู้
- ฝึกระบบอย่างน้อย 500 อีพอค
- ตรวจสอบค่าของการเสียการทดสอบ คุณลดการสูญเสียในการทดสอบให้น้อยกว่า 0.2 ได้ไหม
โซลูชันจะปรากฏใต้ Playgroud
คลิกที่นี่เพื่อดูวิธีแก้ปัญหาของงาน 1
โมเดลนี้แย่มาก โปรดสังเกตว่าจุดสีส้มจำนวนมากลอยอยู่ในทะเลสีฟ้า นอกจากนี้ การสูญเสียใน Test สูงมาก
คลิกที่นี่เพื่อดูวิธีแก้ปัญหาของงาน 2
คุณปรับปรุงประสิทธิภาพของโมเดลได้โดยทำสิ่งต่อไปนี้
-
เลือกทั้งการเปลี่ยนรูปแบบพหุนาม (x12 และ x22) และยกเลิกการเลือกฟีเจอร์อื่นๆ อีก 3 รายการที่เป็นไปได้
-
ลดอัตราการเรียนรู้ให้เหลือ
0.001
หรือต่ำกว่า
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-06-03 UTC
[null,null,["อัปเดตล่าสุด 2025-06-03 UTC"],[[["\u003cp\u003ePlayground is an interactive tool for experimenting with machine learning models by adjusting features and hyperparameters to observe their impact.\u003c/p\u003e\n"],["\u003cp\u003eExercise 1 focuses on feature crosses and manipulating feature weights to achieve accurate model predictions of sick and healthy trees.\u003c/p\u003e\n"],["\u003cp\u003eExercise 2 explores model training, the influence of features and learning rate on model performance, and minimizing test loss for better predictions.\u003c/p\u003e\n"]]],[],null,["# Categorical data: Feature cross exercises\n\n[Playground](https://playground.tensorflow.org/) is an\ninteractive application that lets you manipulate various\naspects of training and testing a machine learning model.\nWith Playground, you can select features and adjust hyperparameters,\nand then discover how your choices influence a model.\n\nThis page contains two Playground exercises.\n\nExercise 1: A basic feature cross\n---------------------------------\n\nFor this exercise, focus on the following parts of the Playground\nuser interface:\n\n- Underneath FEATURES, notice the three potential model features:\n - x~1~\n - x~2~\n - x~1~x~2~\n- Underneath OUTPUT, you'll see a square containing orange and blue dots. Imagine that you're looking at a square forest, where orange dots mark the position of sick trees and blue dots mark the position of healthy trees.\n- Between FEATURES and OUTPUT, if you look very closely, you'll see three faint dashed lines connecting each feature to the output. The width of each dashed line symbolizes the weight currently associated with each feature. These lines are very faint because the starting weight for each feature is initialized to 0. As the weight grows or shrinks, so will the thickness of these lines.\n\n**Task 1:** Explore Playground by doing the following:\n\n1. Click on the faint line that connects feature x~1~ to the output. A popup appears.\n2. In the popup, enter the weight `1.0`.\n3. Press Enter.\n\nNotice the following:\n\n- The dashed line for x~1~ becomes thicker as the weight increases from 0 to 1.0.\n- An orange and blue background now appears.\n - The orange background is the model's guesses as to where the sick trees are.\n - The blue background is the model's guesses as to where the healthy trees are. The model is doing a terrible job; about half of the model's guesses are wrong.\n- Because the weight is 1.0 for x~1~ and 0 for the other features, the model matches x~1~'s values exactly.\n\n**Task 2:** Change the weights of any or all of the three features so that the\nmodel (the background colors) successfully predicts sick and healthy\ntrees. The solution appears just below Playground.\n\n\u003cbr /\u003e\n\n\n*** ** * ** ***\n\n*** ** * ** ***\n\n**Click here for the solution to Task 2** \n- *w~1~* = 0\n- *w~2~* = 0\n- *x~1~* *x~2~* = any positive value\n\nJust for fun, what happens if you input a negative value for the feature\ncross?\n\nExercise 2: A more sophisticated feature cross\n----------------------------------------------\n\nFor the second exercise, look at the arrangement of orange dots (sick trees)\nand blue dots (healthy trees) in the output model, noticing the following:\n\n- The dots form roughly spherical patterns.\n- The arrangement of dots is noisy; for example, notice the occasional blue dots in the outer sphere of orange dots. Consequently, even a great model is unlikely to correctly predict each dot.\n\n**Task 1:** Explore the Playground UI by doing the following:\n\n1. Click the Run/Pause button, which is a white triangle inside a black circle. Playground will begin training the model; observe the Epochs counter increasing.\n2. After the system has trained for at least 300 epochs, press that same Run/Pause button to pause the training.\n3. Look at the model. Is the model making good predictions? In other words, are the blue dots generally surrounded by a blue background, and are the orange dots generally surrounded by an orange background?\n4. Examine the value of Test loss, which appears just below OUTPUT. Is this value closer to 1.0 (higher loss) or closer to 0 (lower loss)?\n5. Reset Playground by pressing the curvy arrow to the left of the Run/Pause button.\n\n**Task 2:** Build a better model by doing the following:\n\n1. Select or deselect any combination of the five possible features.\n2. Adjust the learning rate.\n3. Train the system for at least 500 epochs.\n4. Examine the value of Test loss. Can you get a Test loss less than 0.2?\n\nSolutions appear below Playground.\n\n*** ** * ** ***\n\n*** ** * ** ***\n\n**Click here for the solution to Task 1** \nThe model is terrible. Notice, for example, that many of the orange\ndots are swimming in a sea of blue. Furthermore, Test loss is very high.\n**Click here for the solution to Task 2** \n\nYou can improve model performance by doing the following:\n\n- Select both polynomial transforms (x~1~^2^ and x~2~^2^) and unselect the other three possible features.\n- Reduce the learning rate to `0.001` or lower. \n[Help Center](https://support.google.com/machinelearningeducation)"]]