Skip to content
Snippets Groups Projects
Commit 164fc16b authored by aastorg2's avatar aastorg2
Browse files

merging

parent f25aadeb
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ def load_positive_examples(file_name: str) -> List[Tuple[float, ...]]:
truth_samples_seq = [(t, [s for s in raw_samples if not any(np.isnan(s))])
for t, raw_samples in truth_samples_seq]
# Convert from sampled states and percepts to positive examples for learning
return [
s for _, samples in truth_samples_seq for s in samples
]
......@@ -82,6 +83,7 @@ def synth_dtree(positive_examples, teacher, num_max_iterations: int = 10):
past_candidate_list.append(candidate_dnf)
# QUERYING TEACHER IF THERE ARE NEGATIVE EXAMPLES
print(f"number of paths: {len(candidate_dnf)}")
negative_examples = []
for candidate in candidate_dnf:
result = teacher.check(candidate)
......@@ -112,7 +114,10 @@ def synth_dtree(positive_examples, teacher, num_max_iterations: int = 10):
print("we are done!")
return past_candidate_list
#if k == 2:
# exit(0)
print("Reached max iteration %d." % num_max_iterations)
return []
......
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