sisl / ExprOptimization.jl

Algorithms for optimization of Julia expressions
Other
44 stars 11 forks source link

Print expression used per iteration #7

Closed flare9x closed 6 years ago

flare9x commented 6 years ago

Hi!

While the GE is running, is it possible to print out each expression being tested to the console?

If we take the symbolic regression example:

srand(0)
p = GrammaticalEvolution(grammar,:Real,1000,20,10,10,6,0.2,0.4,0.4; select_method=GrammaticalEvolutions.TruncationSelection(300))
results_ge = optimize(p, grammar, :Real, loss)
(results_ge.expr, results_ge.loss)

Can we add somewhere to print each expression per iteration? I just want to make sure its iterating through my grammar correctly.

Thanks! Andrew

** Update:

By reading the faster symbolic regression example. I learned I can place this within the loss function.

print(get_executable(tree, grammar))

Closing.