-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Probe generialized implementation #98
base: master
Are you sure you want to change the base?
Conversation
Tests do not pass. Implementation is also probably to inefficient
Co-authored-by: Nils Mikk <[email protected]>
Remove hardcoded selectpsol function
Add all 3 selection functions for probe and wrote tests
Remove old iterator
…b-AI/HerbSearch.jl into grammar-update-probabilities
…b-AI/HerbSearch.jl into grammar-update-probabilities
Co-authored-by: Nicolae Filat,
…the left over sum directly.
Refactor benchmark file
Co-authored-by: Nils Mikk <[email protected]>
…tside the if then else Remove unused `programs` field
function Base.iterate(iter::GuidedSearchIterator, state::GuidedSearchState)::Union{Tuple{RuleNode, GuidedSearchState}, Nothing} | ||
grammar = get_grammar(iter.solver) | ||
start_symbol = get_starting_symbol(iter.solver) | ||
# wrap in while true to optimize for tail call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not get this. Why would you do this exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be that the code that actually returns the outcome of the iteration never returns a program because the programs are skipped because of observational equivalence.
if return_type(grammar, prog.ind) == start_symbol
eval_observation, correct_examples = evaluate_program(prog, grammar, iter.spec, iter.symboltable)
if eval_observation in state.eval_cache # program already cached
continue # maybe this skips all programs...
end
prog._val = (eval_observation, correct_examples)
push!(state.eval_cache, eval_observation) # add result to cache
push!(state.bank[state.level+1], prog) # add program to bank
return (prog, state) # return program
end
The while true
forces the function to keep executing until a program is returned. We could have called the function recursively but using an iterative approach is better I think.
The ProgramCache struct and evaluation function is moved to probe_utilities.jl
I did a bit of a hack to add the HerbGrammar |
Fix some typos and remove commented out lines.
Please switch this back, @nicolaefilat. We don't want to mess with the CI to make it pass. We'll get the |
@ReubenJ I reverted the CI hack :) |
…tation. Update grammar now works with log base e probabilities.
Hackathon PlanSteps
Optimization
|
We ask for code review to check if the implementation is up to standards.
It requires HerbGrammar to be on branch
fix-normalizing
to pass tests.