def tps_nr_err(x_ma, lin_ag, trans_g, w_ng, x_na):
    M,D = x_ma.shape

    grad_mga = tps_grad(x_ma, lin_ag, trans_g, w_ng, x_na)
    err_mab = np.empty((M,D,D))
    for m in xrange(M):
        err_mab[m] = np.dot(grad_mga[m].T, grad_mga[m]) - np.eye(D)
    return err_mab.flatten()
green's strain
dataset/ETHPy150Open rll/lfd/lfd/tpsopt/tps.py/tps_nr_err