I am currently going through the notebooks and I don't know how to modify the selelct_action function in Chapter01_Tic_Tac_Toe to use a greedy action selection.
This is my first approach:
explorer = EpsilonGreedyExplorer(0.0)
function select_action(env, V)
A = legal_action_space(env)
values = map(A) do a
V(child(env, a))
end
A[explorer(values)]
end
policies2 = policies
policies2.agents[x].policy.policy.mapping = select_action
which results in:
setfield!: immutable struct of type VBasedPolicy cannot be changed
Stacktrace:
[1] setproperty!(x::VBasedPolicy{MonteCarloLearner{TabularVApproximator{Vector{Float64}, InvDecay}, ReinforcementLearningZoo.FirstVisit, ReinforcementLearningZoo.NoSampling}, typeof(select_action)}, f::Symbol, v::Function)
@ Base ./Base.jl:43
[2] top-level scope
@ /workspaces/ReinforcementLearningAnIntroduction.jl/jupyter-notebook/Chapter01_Tic_Tac_Toe.ipynb:2
I am currently going through the notebooks and I don't know how to modify the
selelct_action
function inChapter01_Tic_Tac_Toe
to use a greedy action selection.This is my first approach:
which results in: