def test_smoother_ref_traj6_1(): """ test_smoother_ref_traj6_1 """ traj = simple_traj6() theta = np.array([-1.0, 1.0]) smoother_ref = TrajectorySmootherRef(traj, theta) smoother_ref.computeProbs() smoother_1 = TrajectorySmoother1(traj, theta) smoother_1.computeProbs() check_probs(smoother_1, smoother_ref)
def test_smoother_ref_traj6_1(): """ test_smoother_ref_traj6_1 """ traj = simple_traj6() theta = np.array([-1.0, 1.0]) smoother_ref = TrajectorySmootherRef(traj, theta) smoother_ref.computeProbs() smoother_1 = TrajectorySmoother1(traj, theta) smoother_1.computeProbs() check_probs(smoother_1, smoother_ref)
def test_filter_ref_traj6_1(): """ test_filter_ref_traj6_1 """ traj = simple_traj6() theta = np.array([-1.0, 1.0]) for k in range(traj.L): filter_ref = TrajectoryFilterRef(traj, theta, k) filter_ref.computeProbs() filter_1 = TrajectoryFilter1(traj, theta, k) filter_1.computeProbs() check_probs(filter_1, filter_ref)
def test_filter_ref_traj6_1(): """ test_filter_ref_traj6_1 """ traj = simple_traj6() theta = np.array([-1.0, 1.0]) for k in range(traj.L): filter_ref = TrajectoryFilterRef(traj, theta, k) filter_ref.computeProbs() filter_1 = TrajectoryFilter1(traj, theta, k) filter_1.computeProbs() check_probs(filter_1, filter_ref)
def test_viterbi_1_6(): """ test_viterbi_1_6 """ traj = simple_traj6() theta = np.array([1.0, -1.0]) viterbi_ref = TrajectoryViterbiRef(traj, theta) viterbi_ref.computeMostLikely() viterbi_1 = TrajectoryViterbi1(traj, theta) viterbi_1.computeMostLikely() assert len(viterbi_1.most_likely) == traj.L for l in range(traj.L): assert viterbi_1.most_likely[l] == viterbi_ref.most_likely[l] assert traj.num_choices[l] == len(viterbi_ref.most_likely_tree[l]) for i in range(traj.num_choices[l]): assert viterbi_ref.most_likely_tree[l][i] == \ viterbi_1.most_likely_tree[l][i]
def test_viterbi_1_6(): """ test_viterbi_1_6 """ traj = simple_traj6() theta = np.array([1.0, -1.0]) viterbi_ref = TrajectoryViterbiRef(traj, theta) viterbi_ref.computeMostLikely() viterbi_1 = TrajectoryViterbi1(traj, theta) viterbi_1.computeMostLikely() assert len(viterbi_1.most_likely) == traj.L for l in range(traj.L): assert viterbi_1.most_likely[l] == viterbi_ref.most_likely[l] assert traj.num_choices[l] == len(viterbi_ref.most_likely_tree[l]) for i in range(traj.num_choices[l]): assert viterbi_ref.most_likely_tree[l][i] == \ viterbi_1.most_likely_tree[l][i]