且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

未知正则化器:tensorflow.js中的L2

更新时间:2023-12-02 18:33:58

选项1

没有类 L1 L2 ;它们只是接口(更多此处)

There are no classes L1 and L2; they are just interfaces(more here)

有一个类 L1L2 ,它将接受配置并返回正确的正则化器.您可以将所有出现的 L2 替换为 L1L2 .

There is a class L1L2 which will take the config and return the right regularizer. You can manually replace all occurences of L2 to L1L2.

选项2

注册L2类

class L2 {

    static className = 'L2';

    constructor(config) {
       return tf.regularizers.l1l2(config)
    }
}
tf.serialization.registerClass(L2);

// now load the model