コード例 #1
0
def test_hess_traj4_1():
  """ test_hess_traj4_1 """
  traj = simple_traj4()
  theta = np.array([0.0, -1.0])
  choices = [1, 0, 2]
  elts = LearningElements(traj, theta, choices)
  elts.computeHessianLogZ()
  elts_ref = LearningElementsRef(traj, theta, choices)
  elts_ref.computeHessianLogZ()
  h = elts.hess_logZ
  h_ref = elts_ref.hess_logZ
  assert(np.abs(h - h_ref).max() < 1e-3), (h, h_ref)