คู่มือพื้นฐาน

ฟังก์ชั่นการสูญเสีย

A loss defines the objective used to assess predictions or another training target.

ฟังคำแนะนำนี้บรรยายโดย AI · ~3 min

บนหน้านี้อ่าน 3 นาที
  1. ภาพรวม
  2. เจาะลึก
  3. การใช้งานจริงในโลกแห่งความเป็นจริง
  4. อนาคตของฟังก์ชันการสูญเสีย
  5. การนำไปปฏิบัติ
  6. สำรวจต่อไป
  7. คำถามที่พบบ่อย

ภาพรวม

Individual loss values are often combined into a scalar for optimization, and the chosen objective is a proxy that may differ from the application's evaluation metric.

เจาะลึก

A prediction loss compares outputs with training targets according to a specified rule. Those targets can be labels or values constructed for the learning task; they should not automatically be called unquestionable truth. Implementations may produce per-example losses and then sum or average them for an optimization step. Choosing the rule matters. Mean squared error averages squared residuals, giving large residuals more influence than mean absolute error, which averages their absolute values. For residuals one and three, mean squared error is five, while mean absolute error is two. These are illustrative calculations rather than performance results from a dataset. Classification commonly uses cross-entropy. With a one-hot target and a predicted probability p for its class, the loss is minus log p. A lower probability for the target class gives a larger loss, so confident wrong predictions can incur high loss. The logarithm base determines the units: base-two loss is in bits, while a natural logarithm gives nats. For a target probability of one-quarter, minus log-base-two p is two bits. Gradient-based optimization needs usable derivative information, but differentiability requirements should not be generalized to every learning algorithm. Some losses have nondifferentiable points handled by an appropriate subgradient or surrogate. Accuracy is a discrete evaluation metric and is generally not directly useful as a gradient-training objective. A suitable training loss supplies an optimization signal; final task quality needs evaluation using the relevant metrics.

การใช้งานจริงในโลกแห่งความเป็นจริง

การใช้การสูญเสียเอนโทรปีข้ามเพื่อฝึกตัวแยกประเภทสแปมอีเมลที่จะลงโทษการจัดประเภทที่ไม่ถูกต้องอย่างมั่นใจ

การเลือกค่าเฉลี่ยความคลาดเคลื่อนสัมบูรณ์สำหรับการทำนายราคาบ้าน ดังนั้นคฤหาสน์สุดโต่งบางแห่งจึงไม่ครอบงำการฝึกอบรม

การใช้การลดความเปรียบต่างเพื่อให้โมเดลการจดจำใบหน้าดึงภาพของบุคคลคนเดียวกันมารวมกัน

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

อนาคตของฟังก์ชันการสูญเสีย

Objective design can combine prediction terms, regularization, and other task requirements. Comparisons should state the target definition, formula, reduction, units, and evaluation metric. An objective can decrease while an application metric remains unchanged or worsens, so improvement should be measured rather than inferred from training loss alone. Custom losses need examination of the behavior they encourage as well as their numerical and optimization properties.

การนำไปปฏิบัติ

ทำไมมันถึงสำคัญ

  • การตัดสินใจที่ชัดเจนยิ่งขึ้น. ช่วยให้คุณแยกคำกล่าวอ้างทางเทคนิคที่ชัดเจนออกจากภาษาทางการตลาดได้
  • ต้นทุนและงบประมาณ. คุณสามารถถามคำถามการใช้งานที่ดีขึ้นก่อนที่จะใช้เงินหรือเวลา
  • ทีมงานและขั้นตอนการทำงาน. ทีมที่มีความเข้าใจร่วมกันจะตัดสินใจเกี่ยวกับผลิตภัณฑ์ นโยบาย และการเรียนรู้ได้ดีขึ้น

ระวัง

  • แต่ละทีมอาจใช้คำเดียวกันต่างกัน ดังนั้นควรกำหนดขอบเขตตั้งแต่เนิ่นๆ
  • เกณฑ์มาตรฐานอาจดูแข็งแกร่งในขณะที่ประสิทธิภาพในโลกแห่งความเป็นจริงไม่เท่ากัน
  • การเพิกเฉยต่อคุณภาพข้อมูลและแผนการประเมินมักสร้างผลลัพธ์ที่เปราะบาง

ขั้นตอนต่อไป

  1. เริ่มต้นด้วยคำจำกัดความภาษาธรรมดาของผลลัพธ์ที่คุณต้องการ
  2. เลือกเมตริกวัดความสำเร็จหนึ่งรายการและเงื่อนไขความล้มเหลวหนึ่งรายการก่อนการทดสอบ
  3. ดำเนินการนำร่องขนาดเล็กด้วยข้อมูลตัวแทน ไม่ใช่ชุดสาธิตที่สวยงาม
  4. เอกสารที่ฟังก์ชันการสูญเสียช่วยได้ และวิธีที่ง่ายกว่าจะดีกว่า

สำรวจต่อไป

จดหมายข่าวฟรี

รับสรุป AI รายวัน

เรื่องราว AI ที่ตรวจสอบแล้ว 3 เรื่องทุกวันทำงาน เช้า, เขียนเป็นภาษาอังกฤษธรรมดา ฟรีตลอดไป ไม่มีโฆษณา

อีเมลหนึ่งฉบับทุกวันทำงาน ยกเลิกการสมัครในคลิกเดียว เราไม่เคยขายหรือแชร์ที่อยู่อีเมลของคุณ

ทดสอบตัวเอง

Take the Loss Functions quiz

ข้อเสนอแนะทันทีสำหรับทุกคำตอบ และใบรับรองที่สามารถแชร์ได้พร้อม ID ที่ตรวจสอบได้เมื่อคุณผ่านหลักสูตร

เริ่มแบบทดสอบ

สนับสนุนการศึกษา AI ฟรี AI Understanding เป็นองค์กรไม่แสวงหาผลกำไร 501(c)(3) — ไม่มีโฆษณา ไม่มีกำแพงเงิน, ตลอดไป บริจาค

คำถามที่พบบ่อย

What is Loss Functions?

A loss defines the objective used to assess predictions or another training target. Individual loss values are often combined into a scalar for optimization, and the chosen objective is a proxy that may differ from the application's evaluation metric.

For a prediction task, what does its selected loss quantify against the training target?

A loss defines a training objective; it does not automatically measure every aspect of application quality.

ฟังก์ชันการสูญเสียใดที่ใช้บ่อยที่สุดสำหรับงานจำแนกประเภท?

เอนโทรปีข้ามจะเปรียบเทียบการแจกแจงความน่าจะเป็นที่คาดการณ์ไว้กับป้ายกำกับที่แท้จริง และเป็นตัวเลือกมาตรฐานสำหรับการจำแนกประเภท

เมื่อเปรียบเทียบกับค่าคลาดเคลื่อนกำลังสองเฉลี่ย ทำไมคุณถึงเลือกค่าคลาดเคลื่อนสัมบูรณ์แบบเฉลี่ย

ข้อผิดพลาดเฉลี่ยสัมบูรณ์จะถือว่าข้อผิดพลาดทั้งหมดเป็นสัดส่วนแทนที่จะยกกำลังสอง ดังนั้นค่าผิดปกติสุดขีดสองสามค่าจึงมีอิทธิพลน้อยกว่า

Why does gradient-based training need a usable loss derivative or suitable substitute?

This concerns gradient-based training, not a claim that every possible learning algorithm requires a differentiable loss.

How does one-hot class cross-entropy change as probability assigned to the target class becomes very small?

The term minus log p grows as the target-class probability shrinks. This does not guarantee a particular gradient magnitude for every model weight.

เรียนรู้ต่อไป

คำแนะนำที่เกี่ยวข้อง

คำแนะนำเพิ่มเติมที่เลือกสำหรับหัวข้อนี้

รับใบรับรอง AI ฟรีหลักสูตรและการสอบสั้น ๆ ฟรี ไม่มีค่าใช้จ่าย ไม่มีบัตรเครดิต ประมาณ 2.5 ชั่วโมงเริ่มต้นฟรี →