Skip to content
Snippets Groups Projects
Commit c53b0ded authored by chsieh16's avatar chsieh16
Browse files

Refactor top level algorithm

parent a6b2613e
No related branches found
No related tags found
No related merge requests found
...@@ -67,19 +67,19 @@ def extractAiBi(term): ...@@ -67,19 +67,19 @@ def extractAiBi(term):
def test_synth_region(): def test_synth_region():
teacher = FirstpassTeacher()
# x >= 6.0 and y >= 5
# teacher.set_old_state_bound(lb=[6.0, 5.0], ub=[11.0, 10.0])
synth_region(teacher)
def synth_region(teacher, num_max_iterations: int = 10):
# Chiao: Read in positive samples # Chiao: Read in positive samples
positive_examples: List[Tuple[float, ...]] = [ positive_examples: List[Tuple[float, ...]] = [
(10.0, -10.0, 11.0, -11.0), (10.0, -10.0, 11.0, -11.0),
(10.0, -10.0, 9.0, -9.0), (10.0, -10.0, 9.0, -9.0),
(1.0, 1.0, 1.5, 2.3), (1.0, 1.0, 1.5, 2.3),
] ]
teacher = FirstpassTeacher()
# x >= 6.0 and y >= 5
# teacher.set_old_state_bound(lb=[6.0, 5.0], ub=[11.0, 10.0])
synth_region(positive_examples, teacher)
def synth_region(positive_examples, teacher, num_max_iterations: int = 10):
learner = FirstpassLearner(state_dim=teacher.state_dim, learner = FirstpassLearner(state_dim=teacher.state_dim,
perc_dim=teacher.perc_dim) perc_dim=teacher.perc_dim)
learner.add_positive_examples(*positive_examples) learner.add_positive_examples(*positive_examples)
......
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