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
评论列表
文章目录