(self, sample)
return l, lx, lu, lxx, luu, lux
Evaluate cost function and derivatives on a sample.
        Args:
            sample: A single sample
Evaluate cost function and derivatives on a sample.
        Args:
            sample: A single sample
Evaluate cost function and derivatives on a sample . Args : sample : A single sample
def eval(self, sample):
        """
        Evaluate cost function and derivatives on a sample.
        Args:
            sample: A single sample
        """
        sample_u = sample.get_U()
        T = sample.T
        Du = sample.dU
        Dx = sample.dX
        l = 0.5 * np.sum(self._hyperparams['wu'] * (sample_u ** 2), axis=1)
        lu = self._hyperparams['wu'] * sample_u
        lx = np.zeros((T, Dx))
        luu = np.tile(np.diag(self._hyperparams['wu']), [T, 1, 1])
        lxx = np.zeros((T, Dx, Dx))
        lux = np.zeros((T, Du, Dx))
        return l, lx, lu, lxx, luu, lux
def eval ( self , sample ) : sample_u = sample . get_U ( ) T = sample . T Du = sample . dU Dx = sample . dX l = 0.5 * np . sum ( self . _hyperparams [ 'wu' ] * ( sample_u ** 2 ) , axis = 1 ) lu = self . _hyperparams [ 'wu' ] * sample_u lx = np . zeros ( ( T , Dx ) ) luu = np . tile ( np . diag ( self . _hyperparams [ 'wu' ] ) , [ T , 1 , 1 ] ) lxx = np . zeros ( ( T , Dx , Dx ) ) lux = np . zeros ( ( T , Du , Dx ) ) return l , lx , lu , lxx , luu , lux