models.py 文件源码

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

项目:keras-gp 作者: alshedivat 项目源码 文件源码
def evaluate(self, X, Y, batch_size=32, verbose=0):
        """Compute NLML on the given data.

        Arguments:
        ----------
            X : np.ndarray or list of np.ndarrays
            Y : np.ndarray or list of np.ndarrays
            batch_size : uint (default: 128)
            verbose : uint (default: 0)
                Verbosity mode, 0 or 1.

        Returns:
        --------
            nlml : float
        """
        # Validate user data
        X, Y, _ = self._standardize_user_data(
            X, Y,
            sample_weight=None,
            class_weight=None,
            check_batch_axis=False,
            batch_size=batch_size)

        H = self.transform(X, batch_size=batch_size)

        nlml = 0.
        for gp, h, y in zip(self.output_gp_layers, H, Y):
            nlml += gp.backend.evaluate('tmp', h, y)

        return nlml
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号