can't store iters, fitness, and best minimizer via callback
I have been trying to store
- the current number of iterations
- the best fitness found so far
- the genome of the individual with that value Through a callback function and have been trying to work with trace to get there right information into the callback.
When I don't override the trace function can call I get: fieldnames(typeof(oc)) = (:iteration, :value, :metadata) for the value of os
If I override the trace! function and set store_trace to true, no matter what I add to the dictionary I get fieldnames(typeof(tr)) = () for the value of tr that I can see gets passed in in this case
I feel like this should be possible.
Maybe one solution would be to give the callback function an intermediate state of the results such that this would work:
function callback(intermediate_res) items = Evolutionary.iterations(intermediate_res) best_indv = Evolutionary.minimizer(intermediate_res) best_fit = minimum(intermediate_res) . .
Code to save values
. return false end
Here is a docs page about traces: Look here: https://wildart.github.io/Evolutionary.jl/dev/tutorial/#Trace-1
This is an example of using it https://github.com/wildart/Evolutionary.jl/blob/30d677fcfc19d517f2a974a00bafda34656c468c/test/onemax.jl#L7-L10