Closed smart-fr closed 1 year ago
You might be able to do it by overriding the following function in src/ui/session.jl
:
function Handlers.iteration_finished(session::Session, report)
bench = run_benchmark(session)
save_increment!(session, bench, report)
flush(Log.logfile(session.logger))
end
Session should contain the current iteration number
Thank you!
I commented the 2 first instructions of this function (as well as the same instructions in function zeroth_iteration!(session::Session)
) and it works, at least to skip all benchmarks.
Thank you! I commented the 2 first instructions of this function (as well as the same instructions in
function zeroth_iteration!(session::Session)
) and it works, at least to skip all benchmarks.
Just be careful with save_increment, you still want to be able to continue the session if you interrupted the script or something... so you probably need some of the code in save_increment...
Oh you are right, thank you again! I amended my changes, reverting function Handlers.iteration_finished(session::Session, report)
and function zeroth_iteration!(session::Session)
back to their original state, but changing function run_benchmark(session::Session)
as below and also allowing benchmark
to equal nothing, in src/ui/session.jl
and src/ui/experiments.jl
:
function run_benchmark(session::Session)
report = Report.Benchmark()
if !isnothing(session.benchmark)
for duel in session.benchmark
outcome = run_duel(session.env, duel, logger=session.logger)
push!(report, outcome)
end
end
return report
end
During a training, I would like to start computing benchmarks only after several iterations were executed. Even potentially not computing benchmarks at all, for some experiments. I am not quite sure how to modify AlphaZero.jl without breaking anything. Would you have some guidance, please? NB. Setting
benchmark=[]
inparams.jl
doesn't work: