test_model_wrappers.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:importance-sampling 作者: idiap 项目源码 文件源码
def _get_model2(self):
        x1 = Input(shape=(10,))
        x2 = Input(shape=(10,))
        y = dot([
            Dense(10)(x1),
            Dense(10)(x2)
        ], axes=1)
        model = Model(inputs=[x1, x2], outputs=y)
        model.compile(loss="mse", optimizer="adam")

        wrapped = OracleWrapper(model, BiasedReweightingPolicy(), score="loss")

        x = [np.random.rand(16, 10), np.random.rand(16, 10)]
        y = np.random.rand(16, 1)

        return model, wrapped, x, y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号