ML ที่ยืดหยุ่น ควบคุมและตีความได้พร้อมโมเดลแบบตาข่าย

import numpy as np
import tensorflow as tf
import tensorflow_lattice as tfl

model = tf.keras.models.Sequential()
model.add(
    tfl.layers.ParallelCombination([
        # Monotonic piece-wise linear calibration with bounded output
        tfl.layers.PWLCalibration(
            monotonicity='increasing',
            input_keypoints=np.linspace(1., 5., num=20),
            output_min=0.0,
            output_max=1.0),
        # Diminishing returns
        tfl.layers.PWLCalibration(
            monotonicity='increasing',
            convexity='concave',
            input_keypoints=np.linspace(0., 200., num=20),
            output_min=0.0,
            output_max=2.0),
        # Partially monotonic categorical calibration: calib(0) <= calib(1)
        tfl.layers.CategoricalCalibration(
            num_buckets=4,
            output_min=0.0,
            output_max=1.0,
            monotonicities=[(0, 1)]),
    ]))
model.add(
    tfl.layers.Lattice(
        lattice_sizes=[2, 3, 2],
        monotonicities=['increasing', 'increasing', 'increasing'],
        # Trust: model is more responsive to input 0 if input 1 increases
        edgeworth_trusts=(0, 1, 'positive')))
model.compile(...)

TensorFlow Lattice เป็นไลบรารี่ที่ใช้โมเดลแบบขัดแตะที่มีข้อจำกัดและตีความได้ ไลบรารีช่วยให้คุณสามารถใส่ความรู้โดเมนลงในกระบวนการเรียนรู้ผ่านเงื่อนไขทั่วไปหรือ ข้อจำกัดด้านรูปร่าง ที่ขับเคลื่อนด้วยนโยบาย ซึ่งทำได้โดยใช้คอลเลกชันของ เลเยอร์ Keras ที่สามารถตอบสนองข้อจำกัดต่างๆ เช่น ความซ้ำซากจำเจ ความนูน และการโต้ตอบของคุณลักษณะต่างๆ ห้องสมุดยังมี โมเดล สำเร็จรูปและ ตัวประมาณแบบกระป๋อง ที่ติดตั้งง่าย

ด้วย TF Lattice คุณสามารถใช้ความรู้ของโดเมนเพื่อคาดการณ์ได้ดียิ่งขึ้นไปยังส่วนต่างๆ ของพื้นที่อินพุตที่ไม่ครอบคลุมโดยชุดข้อมูลการฝึกอบรม ซึ่งช่วยหลีกเลี่ยงพฤติกรรมของแบบจำลองที่ไม่คาดคิดเมื่อการกระจายการให้บริการแตกต่างจากการแจกจ่ายการฝึกอบรม