Source code for smpl.envs.helpers.helper_funcs
import numpy as np
# fit calculation
[docs]def fitting_score(
y,
yhat
):
ey = y - yhat
em = y - np.mean(y)
return 100.0 * (1 - np.linalg.norm(ey) / np.linalg.norm(em))
# mean squared error
# Kalman filter
[docs]def state_estimator(
x,
u,
ym,
A,
B,
C,
K
):
xe = np.matmul(A, x) \
+ np.matmul(B, u) \
+ np.matmul(K, ym - np.matmul(C, x))
return np.array(xe).ravel()