1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

Plot rewards during process

This commit is contained in:
Mo 2022-05-01 17:09:35 +02:00
parent cbf9c1528d
commit 4d5b9552fd

View file

@ -19,6 +19,7 @@ using Random: Random
using ProgressMeter: ProgressMeter using ProgressMeter: ProgressMeter
using JLD2: JLD2 using JLD2: JLD2
using LaTeXStrings: LaTeXStrings, @L_str using LaTeXStrings: LaTeXStrings, @L_str
using UnicodePlots: UnicodePlots
using ..ReCo: ReCo using ..ReCo: ReCo
@ -32,7 +33,7 @@ const DEFAULT_UPDATE_ACTIONS_AT = 0.1
const DEFAULT_N_PARTICLES = 100 const DEFAULT_N_PARTICLES = 100
const DEFAULT_SEED = 42 const DEFAULT_SEED = 42
const DEFAULT_ϵ_STABLE = 0.00001 const DEFAULT_ϵ_STABLE = 0.00001
const DEFAULT_PACKING_FRACTION = 0.01 const DEFAULT_PACKING_FRACTION = 0.02
const DEFAULT_SHOW_PROGRESS = true const DEFAULT_SHOW_PROGRESS = true
const DEFAULT_SHOW_SIMULATION_PROGRESS = true const DEFAULT_SHOW_SIMULATION_PROGRESS = true
const DEFAULT_REWARD_DISCOUNT = 0.1 const DEFAULT_REWARD_DISCOUNT = 0.1
@ -202,7 +203,12 @@ function run_rl(
JLD2.save_object(env_helper_path, env_helper) JLD2.save_object(env_helper_path, env_helper)
end end
ProgressMeter.next!(progress; showvalues=[(:rewards, hook.rewards)]) ProgressMeter.next!(
progress;
showvalues=[(
:R, repr(UnicodePlots.lineplot(1:episode, hook.rewards; border=:none))
)],
)
end end
# Post experiment # Post experiment