Skip to content
Snippets Groups Projects
Commit 306ffd80 authored by aastorg2's avatar aastorg2
Browse files

Merge branch 'main' of gitlab.engr.illinois.edu:chsieh16/cs598mp-fall2021-proj into main

parents cb0b5493 8e6aab93
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ def test_synth_region(): ...@@ -31,6 +31,7 @@ def test_synth_region():
i_th = 0 # select only the i-th partition i_th = 0 # select only the i-th partition
truth_samples_seq = truth_samples_seq[i_th:i_th+1] truth_samples_seq = truth_samples_seq[i_th:i_th+1]
print("Representative point in partition:", truth_samples_seq[0][0])
truth_samples_seq = [(t, [s for s in raw_samples if not any(np.isnan(s))]) truth_samples_seq = [(t, [s for s in raw_samples if not any(np.isnan(s))])
for t, raw_samples in truth_samples_seq] for t, raw_samples in truth_samples_seq]
...@@ -38,7 +39,7 @@ def test_synth_region(): ...@@ -38,7 +39,7 @@ def test_synth_region():
positive_examples: List[Tuple[float, ...]] = [ positive_examples: List[Tuple[float, ...]] = [
s for _, samples in truth_samples_seq for s in samples s for _, samples in truth_samples_seq for s in samples
] ]
ex_dim = len(positive_examples[0]) ex_dim = len(positive_examples[0])
positive_examples = positive_examples[:20:] positive_examples = positive_examples[:20:]
print("#examples: %d" % len(positive_examples)) print("#examples: %d" % len(positive_examples))
...@@ -48,9 +49,8 @@ def test_synth_region(): ...@@ -48,9 +49,8 @@ def test_synth_region():
teacher = Teacher() teacher = Teacher()
assert teacher.state_dim + teacher.perc_dim == ex_dim assert teacher.state_dim + teacher.perc_dim == ex_dim
# x >= 6.0 and y >= 5 # 0.0 <= x <= 30.0 and 0.9 <= y <= 1.0 and -0.2 <= theta <= -0.22
# teacher.set_old_state_bound(lb=[6.0, 5.0], ub=[11.0, 10.0]) teacher.set_old_state_bound(lb=[0.0, 0.9, -0.22], ub=[30.0, 1.0, -0.2])
#[::20]
synth_region(positive_examples, teacher, num_max_iterations=20) synth_region(positive_examples, teacher, num_max_iterations=20)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment