Skip to content

Commit

Permalink
Fixed the remake issue with the parameters
Browse files Browse the repository at this point in the history
@anandpathak31 @harisorgn this version now works with MTK9. Would be good to confirm that it is also getting the correct solution. I notice that it's not using `run_experiment!` though, so the way I implemented hooks won't work with that. Is there a reason it avoids the `run_experiment!` and uses a custom loop instead?
  • Loading branch information
agchesebro committed Aug 19, 2024
1 parent 5b865f4 commit cde0226
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/RF_learning_using_BLOX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,18 @@ end

# ╔═╡ b7e84b20-0b80-478c-bc88-2883f80bcbb4
begin
# sys = Neuroblox.get_sys(agent)
# learning_rules = agent.learning_rules
# weights = Dict{Num, Float64}()
# for w in keys(learning_rules)
# weights[w] = defs[w]
# end


for ii = 1:N_trials
prob3 = agent.problem
stim_params = Neuroblox.get_trial_stimulus(env)
prob3 = remake(prob3; p = merge(weights, stim_params), u0 = u0,tspan=(0,1600))
new_params = ModelingToolkit.MTKParameters(sys, merge(defs, weights, stim_params))
prob3 = remake(prob3; p = new_params, u0=u0, tspan=(0,env.t_trial))
@info env.current_trial
sol2 = solve(prob3, Vern7())
agent.problem = prob3
Expand Down

0 comments on commit cde0226

Please sign in to comment.