diff --git a/assets/literate/DCM.md b/assets/literate/DCM.md index 1d1952a..9b6e47d 100644 --- a/assets/literate/DCM.md +++ b/assets/literate/DCM.md @@ -88,7 +88,7 @@ end finally we compose the simulation model ````julia:ex5 -@named simmodel = system_from_graph(g, split=false) +@named simmodel = system_from_graph(g, split=false); ```` ## Run the simulation and plot the results @@ -226,7 +226,7 @@ for (i, idx) in enumerate(CartesianIndices(A_prior)) end end # Avoid simplification of the model in order to be able to exclude some parameters from fitting -@named fitmodel = system_from_graph(g, simplify=false) +@named fitmodel = system_from_graph(g, simplify=false); ```` With the function `changetune` we can provide a dictionary of parameters whose tunable flag should be changed, for instance set to false to exclude them from the optimization procedure. diff --git a/assets/literate/DCM_script.jl b/assets/literate/DCM_script.jl index eeccdc9..54a2ee1 100644 --- a/assets/literate/DCM_script.jl +++ b/assets/literate/DCM_script.jl @@ -31,7 +31,7 @@ for idx in CartesianIndices(A_true) add_edge!(g, regions[idx[1]] => regions[idx[2]], weight=A_true[idx[1], idx[2]]) end -@named simmodel = system_from_graph(g, split=false) +@named simmodel = system_from_graph(g, split=false); tspan = (0.0, 512.0) prob = SDEProblem(simmodel, [], tspan) @@ -104,7 +104,7 @@ for (i, idx) in enumerate(CartesianIndices(A_prior)) end end # Avoid simplification of the model in order to be able to exclude some parameters from fitting -@named fitmodel = system_from_graph(g, simplify=false) +@named fitmodel = system_from_graph(g, simplify=false); untune = Dict(A[3] => false, A[7] => false) fitmodel = changetune(fitmodel, untune) # 3 and 7 are not present in the simulation model diff --git a/assets/pages/CS_circuit/code/output/cort_asc_stack.svg b/assets/pages/CS_circuit/code/output/cort_asc_stack.svg index 3c3a6d9..bcad436 100644 --- a/assets/pages/CS_circuit/code/output/cort_asc_stack.svg +++ b/assets/pages/CS_circuit/code/output/cort_asc_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,127 +72,127 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_meanfield.svg b/assets/pages/CS_circuit/code/output/cort_meanfield.svg index f846288..56de68c 100644 --- a/assets/pages/CS_circuit/code/output/cort_meanfield.svg +++ b/assets/pages/CS_circuit/code/output/cort_meanfield.svg @@ -2,108 +2,120 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + + + + - + - + + + + + + + + + + - + - - + + @@ -112,130 +124,152 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_power.svg b/assets/pages/CS_circuit/code/output/cort_power.svg index 5ace823..0af44fd 100644 --- a/assets/pages/CS_circuit/code/output/cort_power.svg +++ b/assets/pages/CS_circuit/code/output/cort_power.svg @@ -2,183 +2,180 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - + + - + - + - + - + - + - + - + - + @@ -194,210 +191,210 @@ - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -409,10 +406,10 @@ - - - - + + + + diff --git a/assets/pages/CS_circuit/code/output/cort_stack.svg b/assets/pages/CS_circuit/code/output/cort_stack.svg index c3c4ff2..d38fecb 100644 --- a/assets/pages/CS_circuit/code/output/cort_stack.svg +++ b/assets/pages/CS_circuit/code/output/cort_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,138 +72,138 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/pages/CS_circuit/code/output/wta_stack.svg b/assets/pages/CS_circuit/code/output/wta_stack.svg index 3eb7284..c0b19d7 100644 --- a/assets/pages/CS_circuit/code/output/wta_stack.svg +++ b/assets/pages/CS_circuit/code/output/wta_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,83 +72,83 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + diff --git a/assets/pages/CS_circuit/code/output/wta_wta_stack.svg b/assets/pages/CS_circuit/code/output/wta_wta_stack.svg index aeac2c7..57be4c0 100644 --- a/assets/pages/CS_circuit/code/output/wta_wta_stack.svg +++ b/assets/pages/CS_circuit/code/output/wta_wta_stack.svg @@ -2,66 +2,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72,89 +72,89 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/pages/DCM/code/ex17.jl b/assets/pages/DCM/code/ex17.jl index 09a54b3..9703961 100644 --- a/assets/pages/DCM/code/ex17.jl +++ b/assets/pages/DCM/code/ex17.jl @@ -13,4 +13,4 @@ for (i, idx) in enumerate(CartesianIndices(A_prior)) end end # Avoid simplification of the model in order to be able to exclude some parameters from fitting -@named fitmodel = system_from_graph(g, simplify=false) \ No newline at end of file +@named fitmodel = system_from_graph(g, simplify=false); \ No newline at end of file diff --git a/assets/pages/DCM/code/ex5.jl b/assets/pages/DCM/code/ex5.jl index 02eee15..0dc479f 100644 --- a/assets/pages/DCM/code/ex5.jl +++ b/assets/pages/DCM/code/ex5.jl @@ -1,2 +1,2 @@ # This file was generated, do not modify it. # hide -@named simmodel = system_from_graph(g, split=false) \ No newline at end of file +@named simmodel = system_from_graph(g, split=false); \ No newline at end of file diff --git a/assets/pages/DCM/code/output/ex17.res b/assets/pages/DCM/code/output/ex17.res index 13d714a..97896a0 100644 --- a/assets/pages/DCM/code/output/ex17.res +++ b/assets/pages/DCM/code/output/ex17.res @@ -1,58 +1 @@ -Model fitmodel: -Subsystems (9): see hierarchy(fitmodel) - r1₊ei - r1₊lm - r1₊bm - r2₊ei - r2₊lm - r2₊bm - r3₊ei - r3₊lm - r3₊bm -Equations (27): - 27 standard: see equations(r3₊bm) -Unknowns (27): see unknowns(r3₊bm) - r1₊ei₊u(t): ext_input - r1₊lm₊x(t) [defaults to 0.0] - r1₊lm₊jcn(t) - r1₊bm₊s(t) [defaults to 1.0] - r1₊bm₊lnu(t) [defaults to 0.0] - r1₊bm₊lnν(t) [defaults to 0.0] - r1₊bm₊lnq(t) [defaults to 0.0] - r1₊bm₊jcn(t) - r1₊bm₊bold(t) [defaults to 0.0]: measurement - r2₊ei₊u(t): ext_input - r2₊lm₊x(t) [defaults to 0.0] - r2₊lm₊jcn(t) - r2₊bm₊s(t) [defaults to 1.0] - r2₊bm₊lnu(t) [defaults to 0.0] - r2₊bm₊lnν(t) [defaults to 0.0] - r2₊bm₊lnq(t) [defaults to 0.0] - r2₊bm₊jcn(t) - r2₊bm₊bold(t) [defaults to 0.0]: measurement - r3₊ei₊u(t): ext_input - r3₊lm₊x(t) [defaults to 0.0] - r3₊lm₊jcn(t) - r3₊bm₊s(t) [defaults to 1.0] - r3₊bm₊lnu(t) [defaults to 0.0] - r3₊bm₊lnν(t) [defaults to 0.0] - r3₊bm₊lnq(t) [defaults to 0.0] - r3₊bm₊jcn(t) - r3₊bm₊bold(t) [defaults to 0.0]: measurement -Parameters (16): see parameters(r3₊bm) - C [defaults to 0.0625] - A1 [defaults to 0.0] - w_r1₊lm_r1₊bm [defaults to 1.0] - A2 [defaults to 0.0148102] - A3 [defaults to -0.00716553] - A4 [defaults to 0.00345049] - A5 [defaults to 0.0] - w_r2₊lm_r2₊bm [defaults to 1.0] - A6 [defaults to 0.00429191] - A7 [defaults to -0.0122152] - A8 [defaults to 0.00437472] - A9 [defaults to 0.0] - w_r3₊lm_r3₊bm [defaults to 1.0] - lnκ - lnτ - lnϵ \ No newline at end of file +nothing \ No newline at end of file diff --git a/assets/pages/DCM/code/output/ex5.res b/assets/pages/DCM/code/output/ex5.res index 840498a..97896a0 100644 --- a/assets/pages/DCM/code/output/ex5.res +++ b/assets/pages/DCM/code/output/ex5.res @@ -1,60 +1 @@ -Model simmodel: -Equations (21): - 21 standard: see equations(simmodel) -Unknowns (21): see unknowns(simmodel) - r1₊ou₊x(t) [defaults to 0.0] - r1₊lm₊x(t) [defaults to 0.0] - r1₊bm₊s(t) [defaults to 1.0] - r1₊bm₊lnu(t) [defaults to 0.0] - r1₊bm₊lnν(t) [defaults to 0.0] - r1₊bm₊lnq(t) [defaults to 0.0] - r2₊ou₊x(t) [defaults to 0.0] - r2₊lm₊x(t) [defaults to 0.0] - r2₊bm₊s(t) [defaults to 1.0] - r2₊bm₊lnu(t) [defaults to 0.0] - r2₊bm₊lnν(t) [defaults to 0.0] - r2₊bm₊lnq(t) [defaults to 0.0] - r3₊ou₊x(t) [defaults to 0.0] - r3₊lm₊x(t) [defaults to 0.0] - r3₊bm₊s(t) [defaults to 1.0] - r3₊bm₊lnu(t) [defaults to 0.0] - r3₊bm₊lnν(t) [defaults to 0.0] - r3₊bm₊lnq(t) [defaults to 0.0] - r1₊bm₊bold(t) [defaults to 0.0]: measurement - r2₊bm₊bold(t) [defaults to 0.0]: measurement - r3₊bm₊bold(t) [defaults to 0.0]: measurement -Parameters (33): see parameters(simmodel) - r3₊bm₊lnτ [defaults to 0.0] - r1₊ou₊τ [defaults to 1.0] - r2₊ou₊μ [defaults to 0.0] - r2₊bm₊lnτ [defaults to 0.0] - r3₊ou₊μ [defaults to 0.0] - r3₊bm₊lnκ [defaults to 0.0] - r2₊bm₊lnκ [defaults to 0.0] - r2₊ou₊σ [defaults to 0.1] - r3₊ou₊τ [defaults to 1.0] - r3₊bm₊lnϵ [defaults to 0.0] - r2₊bm₊lnϵ [defaults to 0.0] - r1₊ou₊μ [defaults to 0.0] - r2₊ou₊τ [defaults to 1.0] - r1₊bm₊lnϵ [defaults to 0.0] - r1₊bm₊lnκ [defaults to 0.0] - r1₊bm₊lnτ [defaults to 0.0] - r3₊ou₊σ [defaults to 0.1] - r1₊ou₊σ [defaults to 0.1] - w_r1₊ou_r1₊lm [defaults to 0.0625] - w_r2₊lm_r1₊lm [defaults to 0.4] - w_r3₊ou_r3₊lm [defaults to 0.0625] - w_r1₊lm_r1₊lm [defaults to -0.5] - w_r2₊lm_r3₊lm [defaults to -0.3] - w_r1₊lm_r3₊lm [defaults to 0.0] - w_r1₊lm_r2₊lm [defaults to -2.0] - w_r1₊lm_r1₊bm [defaults to 1.0] - w_r2₊ou_r2₊lm [defaults to 0.0625] - w_r2₊lm_r2₊bm [defaults to 1.0] - w_r3₊lm_r3₊lm [defaults to -0.5] - w_r3₊lm_r1₊lm [defaults to 0.0] - w_r3₊lm_r3₊bm [defaults to 1.0] - w_r2₊lm_r2₊lm [defaults to -0.5] - w_r3₊lm_r2₊lm [defaults to 0.2] -Observed (9): see observed(simmodel) \ No newline at end of file +nothing \ No newline at end of file diff --git a/assets/pages/blox_connections/code/output/ex6.res b/assets/pages/blox_connections/code/output/ex6.res index 11c1e9b..58d4130 100644 --- a/assets/pages/blox_connections/code/output/ex6.res +++ b/assets/pages/blox_connections/code/output/ex6.res @@ -1,4 +1,4 @@ -Main.FD_SANDBOX_15604780526313532720.IzhNeuron(ModelingToolkit.ODESystem(0x0000000000001ffd, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ +Main.FD_SANDBOX_15604780526313532720.IzhNeuron(ModelingToolkit.ODESystem(0x0000000000001fe9, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ affects: u(t) ~ d + u(t) V(t) ~ V_reset diff --git a/assets/pages/learning/code/output/adj_RL.svg b/assets/pages/learning/code/output/adj_RL.svg index 714ff65..c9d534c 100644 --- a/assets/pages/learning/code/output/adj_RL.svg +++ b/assets/pages/learning/code/output/adj_RL.svg @@ -2,2223 +2,2223 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2227,4167 +2227,4168 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + - + + - - + - - - - - - + + + + - - - + + + + @@ -6395,33 +6396,34 @@ - - - + + + + - - - - + + + + - - - + + + + - + - - - + + - - + + + - @@ -6430,72 +6432,75 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - + + + + @@ -6506,24 +6511,28 @@ + - + - + + - - + + + + - + @@ -6534,21 +6543,21 @@ - - - + + + + + - - @@ -6556,15 +6565,15 @@ - - - + + + @@ -6583,4164 +6592,4165 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + + + - + + - - + - - - - - - + + + + - - - + + + + @@ -10748,33 +10758,34 @@ - - - + + + + - - - - + + + + - - - + + + + - + - - - + + - - + + + - @@ -10783,72 +10794,75 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - + + + + @@ -10859,24 +10873,28 @@ + - + - + + - - + + + + - + @@ -10887,21 +10905,21 @@ - - - + + + + + - - @@ -10909,15 +10927,15 @@ - - - + + + diff --git a/assets/pages/learning/code/output/adj_open.svg b/assets/pages/learning/code/output/adj_open.svg index 32ea286..f9fb61b 100644 --- a/assets/pages/learning/code/output/adj_open.svg +++ b/assets/pages/learning/code/output/adj_open.svg @@ -2,1628 +2,1628 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1632,3116 +1632,3114 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + + - - - - - + + - - + + @@ -4749,25 +4747,24 @@ - - + + - - + + - - + + - - - + + - - + + @@ -4776,16 +4773,19 @@ - + + + + @@ -4796,24 +4796,28 @@ + - + - + + - - + + + + - + @@ -4824,21 +4828,21 @@ - - - + + + + + - - @@ -4846,15 +4850,15 @@ - - - + + + @@ -4869,3110 +4873,3108 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + + - - - - - + + - - + + @@ -7980,25 +7982,24 @@ - - + + - - + + - - + + - - - + + - - + + @@ -8007,16 +8008,19 @@ - + + + + @@ -8027,24 +8031,28 @@ + - + - + + - - + + + + - + @@ -8055,21 +8063,21 @@ - - - + + + + + - - @@ -8077,15 +8085,15 @@ - - - + + + diff --git a/assets/pages/learning/code/output/ex3.out b/assets/pages/learning/code/output/ex3.out index 9d9a089..862adec 100644 --- a/assets/pages/learning/code/output/ex3.out +++ b/assets/pages/learning/code/output/ex3.out @@ -1,100 +1,100 @@ Trial = 1, Category choice = 1, Response = False -Trial = 2, Category choice = 1, Response = Correct -Trial = 3, Category choice = 1, Response = Correct +Trial = 2, Category choice = 2, Response = False +Trial = 3, Category choice = 2, Response = False Trial = 4, Category choice = 1, Response = False Trial = 5, Category choice = 1, Response = Correct Trial = 6, Category choice = 1, Response = False Trial = 7, Category choice = 1, Response = False -Trial = 8, Category choice = 1, Response = False +Trial = 8, Category choice = 2, Response = Correct Trial = 9, Category choice = 2, Response = Correct -Trial = 10, Category choice = 1, Response = False -Trial = 11, Category choice = 1, Response = False -Trial = 12, Category choice = 1, Response = False +Trial = 10, Category choice = 2, Response = Correct +Trial = 11, Category choice = 2, Response = Correct +Trial = 12, Category choice = 2, Response = Correct Trial = 13, Category choice = 1, Response = Correct Trial = 14, Category choice = 1, Response = False Trial = 15, Category choice = 2, Response = False -Trial = 16, Category choice = 1, Response = Correct +Trial = 16, Category choice = 2, Response = False Trial = 17, Category choice = 2, Response = False -Trial = 18, Category choice = 2, Response = False -Trial = 19, Category choice = 1, Response = Correct -Trial = 20, Category choice = 2, Response = Correct -Trial = 21, Category choice = 1, Response = Correct +Trial = 18, Category choice = 1, Response = Correct +Trial = 19, Category choice = 2, Response = False +Trial = 20, Category choice = 1, Response = False +Trial = 21, Category choice = 2, Response = False Trial = 22, Category choice = 2, Response = False Trial = 23, Category choice = 2, Response = False -Trial = 24, Category choice = 2, Response = Correct -Trial = 25, Category choice = 1, Response = Correct -Trial = 26, Category choice = 1, Response = Correct -Trial = 27, Category choice = 1, Response = Correct -Trial = 28, Category choice = 1, Response = Correct +Trial = 24, Category choice = 1, Response = False +Trial = 25, Category choice = 2, Response = False +Trial = 26, Category choice = 2, Response = False +Trial = 27, Category choice = 2, Response = False +Trial = 28, Category choice = 2, Response = False Trial = 29, Category choice = 1, Response = False -Trial = 30, Category choice = 2, Response = False +Trial = 30, Category choice = 1, Response = Correct Trial = 31, Category choice = 2, Response = Correct Trial = 32, Category choice = 1, Response = Correct Trial = 33, Category choice = 2, Response = Correct -Trial = 34, Category choice = 1, Response = False -Trial = 35, Category choice = 2, Response = Correct -Trial = 36, Category choice = 2, Response = False +Trial = 34, Category choice = 2, Response = Correct +Trial = 35, Category choice = 1, Response = False +Trial = 36, Category choice = 1, Response = Correct Trial = 37, Category choice = 2, Response = False Trial = 38, Category choice = 1, Response = Correct Trial = 39, Category choice = 2, Response = Correct Trial = 40, Category choice = 2, Response = False -Trial = 41, Category choice = 2, Response = Correct -Trial = 42, Category choice = 1, Response = Correct -Trial = 43, Category choice = 2, Response = False -Trial = 44, Category choice = 1, Response = False +Trial = 41, Category choice = 1, Response = False +Trial = 42, Category choice = 2, Response = False +Trial = 43, Category choice = 1, Response = Correct +Trial = 44, Category choice = 2, Response = Correct Trial = 45, Category choice = 1, Response = Correct -Trial = 46, Category choice = 1, Response = Correct +Trial = 46, Category choice = 2, Response = False Trial = 47, Category choice = 2, Response = False -Trial = 48, Category choice = 1, Response = False +Trial = 48, Category choice = 2, Response = Correct Trial = 49, Category choice = 2, Response = Correct -Trial = 50, Category choice = 1, Response = False +Trial = 50, Category choice = 2, Response = Correct Trial = 51, Category choice = 1, Response = Correct -Trial = 52, Category choice = 1, Response = Correct +Trial = 52, Category choice = 2, Response = False Trial = 53, Category choice = 2, Response = Correct -Trial = 54, Category choice = 1, Response = False -Trial = 55, Category choice = 2, Response = Correct +Trial = 54, Category choice = 2, Response = Correct +Trial = 55, Category choice = 1, Response = False Trial = 56, Category choice = 2, Response = Correct -Trial = 57, Category choice = 2, Response = False +Trial = 57, Category choice = 1, Response = Correct Trial = 58, Category choice = 1, Response = Correct -Trial = 59, Category choice = 1, Response = Correct -Trial = 60, Category choice = 1, Response = Correct -Trial = 61, Category choice = 2, Response = Correct +Trial = 59, Category choice = 2, Response = False +Trial = 60, Category choice = 2, Response = False +Trial = 61, Category choice = 1, Response = False Trial = 62, Category choice = 2, Response = Correct Trial = 63, Category choice = 1, Response = False -Trial = 64, Category choice = 1, Response = Correct -Trial = 65, Category choice = 1, Response = Correct +Trial = 64, Category choice = 2, Response = False +Trial = 65, Category choice = 2, Response = False Trial = 66, Category choice = 1, Response = False -Trial = 67, Category choice = 1, Response = Correct +Trial = 67, Category choice = 2, Response = False Trial = 68, Category choice = 2, Response = Correct Trial = 69, Category choice = 1, Response = False -Trial = 70, Category choice = 1, Response = Correct +Trial = 70, Category choice = 2, Response = False Trial = 71, Category choice = 1, Response = Correct Trial = 72, Category choice = 1, Response = False Trial = 73, Category choice = 1, Response = False Trial = 74, Category choice = 1, Response = Correct -Trial = 75, Category choice = 1, Response = Correct -Trial = 76, Category choice = 1, Response = False +Trial = 75, Category choice = 2, Response = False +Trial = 76, Category choice = 2, Response = Correct Trial = 77, Category choice = 2, Response = False Trial = 78, Category choice = 1, Response = Correct -Trial = 79, Category choice = 1, Response = Correct +Trial = 79, Category choice = 2, Response = False Trial = 80, Category choice = 1, Response = Correct -Trial = 81, Category choice = 1, Response = False +Trial = 81, Category choice = 2, Response = Correct Trial = 82, Category choice = 2, Response = False -Trial = 83, Category choice = 1, Response = Correct +Trial = 83, Category choice = 2, Response = False Trial = 84, Category choice = 1, Response = False -Trial = 85, Category choice = 1, Response = False +Trial = 85, Category choice = 2, Response = Correct Trial = 86, Category choice = 1, Response = Correct Trial = 87, Category choice = 1, Response = Correct Trial = 88, Category choice = 1, Response = Correct Trial = 89, Category choice = 1, Response = False -Trial = 90, Category choice = 1, Response = Correct +Trial = 90, Category choice = 2, Response = False Trial = 91, Category choice = 2, Response = Correct -Trial = 92, Category choice = 1, Response = Correct +Trial = 92, Category choice = 2, Response = False Trial = 93, Category choice = 2, Response = Correct Trial = 94, Category choice = 1, Response = False Trial = 95, Category choice = 1, Response = Correct Trial = 96, Category choice = 2, Response = Correct -Trial = 97, Category choice = 1, Response = False +Trial = 97, Category choice = 2, Response = Correct Trial = 98, Category choice = 2, Response = Correct Trial = 99, Category choice = 2, Response = False Trial = 100, Category choice = 2, Response = False diff --git a/assets/pages/learning/code/output/ex3.res b/assets/pages/learning/code/output/ex3.res index 544e7f2..715c9b9 100644 --- a/assets/pages/learning/code/output/ex3.res +++ b/assets/pages/learning/code/output/ex3.res @@ -1 +1 @@ -(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0], action = [1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2]) \ No newline at end of file +(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0], action = [1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2]) \ No newline at end of file diff --git a/pages/DCM/index.html b/pages/DCM/index.html index 407061e..45dcf6e 100644 --- a/pages/DCM/index.html +++ b/pages/DCM/index.html @@ -21,79 +21,30 @@ end

Note that weight=1/16 in the connection between the OU process and the Neural Mass Blox is taken from SPM12. This stabilizes the balloon model simulation. Alternatively the noise of the Ornstein-Uhlenbeck block or the weight of the edge connecting neuronal activity and balloon model could be reduced to guarantee numerical stability. Next we define the between-region connectivity matrix and connect regions; we use the same matrix as is defined in [3]

A_true = [[-0.5 -2 0]; [0.4 -0.5 -0.3]; [0 0.2 -0.5]]
 for idx in CartesianIndices(A_true)
     add_edge!(g, regions[idx[1]] => regions[idx[2]], weight=A_true[idx[1], idx[2]])
-end

finally we compose the simulation model

@named simmodel = system_from_graph(g, split=false)
Model simmodel:
-Equations (21):
-  21 standard: see equations(simmodel)
-Unknowns (21): see unknowns(simmodel)
-  r1₊ou₊x(t) [defaults to 0.0]
-  r1₊lm₊x(t) [defaults to 0.0]
-  r1₊bm₊s(t) [defaults to 1.0]
-  r1₊bm₊lnu(t) [defaults to 0.0]
-  r1₊bm₊lnν(t) [defaults to 0.0]
-  r1₊bm₊lnq(t) [defaults to 0.0]
-  r2₊ou₊x(t) [defaults to 0.0]
-  r2₊lm₊x(t) [defaults to 0.0]
-  r2₊bm₊s(t) [defaults to 1.0]
-  r2₊bm₊lnu(t) [defaults to 0.0]
-  r2₊bm₊lnν(t) [defaults to 0.0]
-  r2₊bm₊lnq(t) [defaults to 0.0]
-  r3₊ou₊x(t) [defaults to 0.0]
-  r3₊lm₊x(t) [defaults to 0.0]
-  r3₊bm₊s(t) [defaults to 1.0]
-  r3₊bm₊lnu(t) [defaults to 0.0]
-  r3₊bm₊lnν(t) [defaults to 0.0]
-  r3₊bm₊lnq(t) [defaults to 0.0]
-  r1₊bm₊bold(t) [defaults to 0.0]: measurement
-  r2₊bm₊bold(t) [defaults to 0.0]: measurement
-  r3₊bm₊bold(t) [defaults to 0.0]: measurement
-Parameters (33): see parameters(simmodel)
-  r3₊bm₊lnτ [defaults to 0.0]
-  r1₊ou₊τ [defaults to 1.0]
-  r2₊ou₊μ [defaults to 0.0]
-  r2₊bm₊lnτ [defaults to 0.0]
-  r3₊ou₊μ [defaults to 0.0]
-  r3₊bm₊lnκ [defaults to 0.0]
-  r2₊bm₊lnκ [defaults to 0.0]
-  r2₊ou₊σ [defaults to 0.1]
-  r3₊ou₊τ [defaults to 1.0]
-  r3₊bm₊lnϵ [defaults to 0.0]
-  r2₊bm₊lnϵ [defaults to 0.0]
-  r1₊ou₊μ [defaults to 0.0]
-  r2₊ou₊τ [defaults to 1.0]
-  r1₊bm₊lnϵ [defaults to 0.0]
-  r1₊bm₊lnκ [defaults to 0.0]
-  r1₊bm₊lnτ [defaults to 0.0]
-  r3₊ou₊σ [defaults to 0.1]
-  r1₊ou₊σ [defaults to 0.1]
-  w_r1₊ou_r1₊lm [defaults to 0.0625]
-  w_r2₊lm_r1₊lm [defaults to 0.4]
-  w_r3₊ou_r3₊lm [defaults to 0.0625]
-  w_r1₊lm_r1₊lm [defaults to -0.5]
-  w_r2₊lm_r3₊lm [defaults to -0.3]
-  w_r1₊lm_r3₊lm [defaults to 0.0]
-  w_r1₊lm_r2₊lm [defaults to -2.0]
-  w_r1₊lm_r1₊bm [defaults to 1.0]
-  w_r2₊ou_r2₊lm [defaults to 0.0625]
-  w_r2₊lm_r2₊bm [defaults to 1.0]
-  w_r3₊lm_r3₊lm [defaults to -0.5]
-  w_r3₊lm_r1₊lm [defaults to 0.0]
-  w_r3₊lm_r3₊bm [defaults to 1.0]
-  w_r2₊lm_r2₊lm [defaults to -0.5]
-  w_r3₊lm_r2₊lm [defaults to 0.2]
-Observed (9): see observed(simmodel)

Run the simulation and plot the results

setup simulation of the model, time in seconds

tspan = (0.0, 512.0)
+end

finally we compose the simulation model

@named simmodel = system_from_graph(g, split=false);
+

Run the simulation and plot the results

+

setup simulation of the model, time in seconds

+
tspan = (0.0, 512.0)
 prob = SDEProblem(simmodel, [], tspan)
 dt = 2   # 2 seconds (units are milliseconds) as measurement interval for fMRI
-sol = solve(prob, ImplicitRKMil(), saveat=dt);

we now want to extract all the variables in our model which carry the tag "measurement". For this purpose we can use the Neuroblox function get_idx_tagged_vars the observable quantity in our model is the BOLD signal, the variable of the Blox BalloonModel that represents the BOLD signal is tagged with "measurement" tag. other tags that are defined are "input" which denotes variables representing a stimulus, like for instance an OUBlox.

idx_m = get_idx_tagged_vars(simmodel, "measurement")    # get index of bold signal
3-element Vector{Int64}:
+sol = solve(prob, ImplicitRKMil(), saveat=dt);
+

we now want to extract all the variables in our model which carry the tag "measurement". For this purpose we can use the Neuroblox function get_idx_tagged_vars the observable quantity in our model is the BOLD signal, the variable of the Blox BalloonModel that represents the BOLD signal is tagged with "measurement" tag. other tags that are defined are "input" which denotes variables representing a stimulus, like for instance an OUBlox.

+
idx_m = get_idx_tagged_vars(simmodel, "measurement")    # get index of bold signal
3-element Vector{Int64}:
  19
  20
- 21

plot bold signal time series

f = Figure()
+ 21
+

plot bold signal time series

+
f = Figure()
 ax = Axis(f[1, 1],
     title = "fMRI time series",
     xlabel = "Time [ms]",
     ylabel = "BOLD",
 )
 lines!(ax, sol, idxs=idx_m)
-f

We note that the initial spike is not meaningful and a result of the equilibration of the stochastic process thus we remove it.

dfsol = DataFrame(sol[ceil(Int, 101/dt):end]);
+f + +

We note that the initial spike is not meaningful and a result of the equilibration of the stochastic process thus we remove it.

+
dfsol = DataFrame(sol[ceil(Int, 101/dt):end]);

Estimate and plot the cross-spectral densities

data = Matrix(dfsol[:, idx_m]);

We compute the cross-spectral density by fitting a linear model of order p and then compute the csd analytically from the parameters of the multivariate autoregressive model

@@ -152,64 +103,7 @@

Model In end end # Avoid simplification of the model in order to be able to exclude some parameters from fitting -@named fitmodel = system_from_graph(g, simplify=false)
Model fitmodel:
-Subsystems (9): see hierarchy(fitmodel)
-  r1₊ei
-  r1₊lm
-  r1₊bm
-  r2₊ei
-  r2₊lm
-  r2₊bm
-  r3₊ei
-  r3₊lm
-  r3₊bm
-Equations (27):
-  27 standard: see equations(r3₊bm)
-Unknowns (27): see unknowns(r3₊bm)
-  r1₊ei₊u(t): ext_input
-  r1₊lm₊x(t) [defaults to 0.0]
-  r1₊lm₊jcn(t)
-  r1₊bm₊s(t) [defaults to 1.0]
-  r1₊bm₊lnu(t) [defaults to 0.0]
-  r1₊bm₊lnν(t) [defaults to 0.0]
-  r1₊bm₊lnq(t) [defaults to 0.0]
-  r1₊bm₊jcn(t)
-  r1₊bm₊bold(t) [defaults to 0.0]: measurement
-  r2₊ei₊u(t): ext_input
-  r2₊lm₊x(t) [defaults to 0.0]
-  r2₊lm₊jcn(t)
-  r2₊bm₊s(t) [defaults to 1.0]
-  r2₊bm₊lnu(t) [defaults to 0.0]
-  r2₊bm₊lnν(t) [defaults to 0.0]
-  r2₊bm₊lnq(t) [defaults to 0.0]
-  r2₊bm₊jcn(t)
-  r2₊bm₊bold(t) [defaults to 0.0]: measurement
-  r3₊ei₊u(t): ext_input
-  r3₊lm₊x(t) [defaults to 0.0]
-  r3₊lm₊jcn(t)
-  r3₊bm₊s(t) [defaults to 1.0]
-  r3₊bm₊lnu(t) [defaults to 0.0]
-  r3₊bm₊lnν(t) [defaults to 0.0]
-  r3₊bm₊lnq(t) [defaults to 0.0]
-  r3₊bm₊jcn(t)
-  r3₊bm₊bold(t) [defaults to 0.0]: measurement
-Parameters (16): see parameters(r3₊bm)
-  C [defaults to 0.0625]
-  A1 [defaults to 0.0]
-  w_r1₊lm_r1₊bm [defaults to 1.0]
-  A2 [defaults to 0.0148102]
-  A3 [defaults to -0.00716553]
-  A4 [defaults to 0.00345049]
-  A5 [defaults to 0.0]
-  w_r2₊lm_r2₊bm [defaults to 1.0]
-  A6 [defaults to 0.00429191]
-  A7 [defaults to -0.0122152]
-  A8 [defaults to 0.00437472]
-  A9 [defaults to 0.0]
-  w_r3₊lm_r3₊bm [defaults to 1.0]
-  lnκ
-  lnτ
-  lnϵ
+@named fitmodel = system_from_graph(g, simplify=false);

With the function changetune we can provide a dictionary of parameters whose tunable flag should be changed, for instance set to false to exclude them from the optimization procedure. For instance the the effective connections that are set to zero in the simulation:

untune = Dict(A[3] => false, A[7] => false)
 fitmodel = changetune(fitmodel, untune)                 # 3 and 7 are not present in the simulation model
diff --git a/pages/blox_connections/index.html b/pages/blox_connections/index.html
index da45c45..0cc8f06 100644
--- a/pages/blox_connections/index.html
+++ b/pages/blox_connections/index.html
@@ -47,7 +47,7 @@
     end
 end
 
-# In the `IzhNeuron` constructor function we keep all arguments as keyword arguments so that we can set them more conveniently as `arg = value`. Spike threshold `θ=30` is now included as a parameter. Default values for all parameters are the keyword arguments from above. This way we can set them easily during construction.

NOTE: In IzhNeuron the jcn variable does not get a default value, only the [input=true] tag. This means that other Bloxs will connect to a IzhNeuron through jcn.

Neuroblox automatically initializes a jcn ~ 0 equation and then accumulates connection terms in it. This happens with all input variables of Bloxs.

Similarly the [output=true] tag designates the V variable as the output variable. It is necessary for every Blox to have one if they rely on generic connection rules that fetch the output variable and add it to the connection equation.

Both input and output tags are also useful to note which variables should be used when writing connection rules to or from our Blox.

Now we are ready to define the first object of IzhNeuron and connect it with the LIFNeuron we created above.

@named izh = IzhNeuron()
IzhNeuron(ModelingToolkit.ODESystem(0x0000000000001ffd, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ
+# In the `IzhNeuron` constructor function we keep all arguments as keyword arguments so that we can set them more conveniently as `arg = value`. Spike threshold `θ=30` is now included as a parameter. Default values for all parameters are the keyword arguments from above. This way we can set them easily during construction.

NOTE: In IzhNeuron the jcn variable does not get a default value, only the [input=true] tag. This means that other Bloxs will connect to a IzhNeuron through jcn.

Neuroblox automatically initializes a jcn ~ 0 equation and then accumulates connection terms in it. This happens with all input variables of Bloxs.

Similarly the [output=true] tag designates the V variable as the output variable. It is necessary for every Blox to have one if they rely on generic connection rules that fetch the output variable and add it to the connection equation.

Both input and output tags are also useful to note which variables should be used when writing connection rules to or from our Blox.

Now we are ready to define the first object of IzhNeuron and connect it with the LIFNeuron we created above.

@named izh = IzhNeuron()
IzhNeuron(ModelingToolkit.ODESystem(0x0000000000001fe9, Symbolics.Equation[Differential(t)(V(t)) ~ 145 + jcn - u(t) + 5V(t) + 0.04(V(t)^2), Differential(t)(u(t)) ~ a*(-u(t) + b*V(t))], t, SymbolicUtils.BasicSymbolic{Real}[V(t), u(t), jcn], SymbolicUtils.BasicSymbolic{Real}[a, b, V_reset, d, θ], nothing, Dict{Any, Any}(:a => a, :b => b, :d => d, :V => V(t), :jcn => jcn, :u => u(t), :θ => θ, :V_reset => V_reset), Any[], Symbolics.Equation[], Base.RefValue{Vector{Symbolics.Num}}(Symbolics.Num[]), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Any}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), Base.RefValue{Matrix{Symbolics.Num}}(Matrix{Symbolics.Num}(undef, 0, 0)), :izh, "", ModelingToolkit.ODESystem[], Dict{Any, Any}(a => 0.02, V_reset => -50, d => 2, u(t) => -13, V(t) => -65.0, b => 0.2, θ => 30), Dict{Any, Any}(), nothing, nothing, Symbolics.Equation[], nothing, nothing, nothing, ModelingToolkit.SymbolicContinuousCallback[], ModelingToolkit.SymbolicDiscreteCallback[condition: V(t) > θ
 affects:
   u(t) ~ d + u(t)
   V(t) ~ V_reset
diff --git a/pages/learning/index.html b/pages/learning/index.html
index 70574f2..05ccdd3 100644
--- a/pages/learning/index.html
+++ b/pages/learning/index.html
@@ -104,106 +104,106 @@
 adjacency(fig[1,1], agent; title = "Before Learning", colorrange=(0,0.2))
 
 trace = run_experiment!(agent, env; t_warmup=200.0, alg=Vern7(), verbose=true)
Trial = 1, Category choice = 1, Response = False
-Trial = 2, Category choice = 1, Response = Correct
-Trial = 3, Category choice = 1, Response = Correct
+Trial = 2, Category choice = 2, Response = False
+Trial = 3, Category choice = 2, Response = False
 Trial = 4, Category choice = 1, Response = False
 Trial = 5, Category choice = 1, Response = Correct
 Trial = 6, Category choice = 1, Response = False
 Trial = 7, Category choice = 1, Response = False
-Trial = 8, Category choice = 1, Response = False
+Trial = 8, Category choice = 2, Response = Correct
 Trial = 9, Category choice = 2, Response = Correct
-Trial = 10, Category choice = 1, Response = False
-Trial = 11, Category choice = 1, Response = False
-Trial = 12, Category choice = 1, Response = False
+Trial = 10, Category choice = 2, Response = Correct
+Trial = 11, Category choice = 2, Response = Correct
+Trial = 12, Category choice = 2, Response = Correct
 Trial = 13, Category choice = 1, Response = Correct
 Trial = 14, Category choice = 1, Response = False
 Trial = 15, Category choice = 2, Response = False
-Trial = 16, Category choice = 1, Response = Correct
+Trial = 16, Category choice = 2, Response = False
 Trial = 17, Category choice = 2, Response = False
-Trial = 18, Category choice = 2, Response = False
-Trial = 19, Category choice = 1, Response = Correct
-Trial = 20, Category choice = 2, Response = Correct
-Trial = 21, Category choice = 1, Response = Correct
+Trial = 18, Category choice = 1, Response = Correct
+Trial = 19, Category choice = 2, Response = False
+Trial = 20, Category choice = 1, Response = False
+Trial = 21, Category choice = 2, Response = False
 Trial = 22, Category choice = 2, Response = False
 Trial = 23, Category choice = 2, Response = False
-Trial = 24, Category choice = 2, Response = Correct
-Trial = 25, Category choice = 1, Response = Correct
-Trial = 26, Category choice = 1, Response = Correct
-Trial = 27, Category choice = 1, Response = Correct
-Trial = 28, Category choice = 1, Response = Correct
+Trial = 24, Category choice = 1, Response = False
+Trial = 25, Category choice = 2, Response = False
+Trial = 26, Category choice = 2, Response = False
+Trial = 27, Category choice = 2, Response = False
+Trial = 28, Category choice = 2, Response = False
 Trial = 29, Category choice = 1, Response = False
-Trial = 30, Category choice = 2, Response = False
+Trial = 30, Category choice = 1, Response = Correct
 Trial = 31, Category choice = 2, Response = Correct
 Trial = 32, Category choice = 1, Response = Correct
 Trial = 33, Category choice = 2, Response = Correct
-Trial = 34, Category choice = 1, Response = False
-Trial = 35, Category choice = 2, Response = Correct
-Trial = 36, Category choice = 2, Response = False
+Trial = 34, Category choice = 2, Response = Correct
+Trial = 35, Category choice = 1, Response = False
+Trial = 36, Category choice = 1, Response = Correct
 Trial = 37, Category choice = 2, Response = False
 Trial = 38, Category choice = 1, Response = Correct
 Trial = 39, Category choice = 2, Response = Correct
 Trial = 40, Category choice = 2, Response = False
-Trial = 41, Category choice = 2, Response = Correct
-Trial = 42, Category choice = 1, Response = Correct
-Trial = 43, Category choice = 2, Response = False
-Trial = 44, Category choice = 1, Response = False
+Trial = 41, Category choice = 1, Response = False
+Trial = 42, Category choice = 2, Response = False
+Trial = 43, Category choice = 1, Response = Correct
+Trial = 44, Category choice = 2, Response = Correct
 Trial = 45, Category choice = 1, Response = Correct
-Trial = 46, Category choice = 1, Response = Correct
+Trial = 46, Category choice = 2, Response = False
 Trial = 47, Category choice = 2, Response = False
-Trial = 48, Category choice = 1, Response = False
+Trial = 48, Category choice = 2, Response = Correct
 Trial = 49, Category choice = 2, Response = Correct
-Trial = 50, Category choice = 1, Response = False
+Trial = 50, Category choice = 2, Response = Correct
 Trial = 51, Category choice = 1, Response = Correct
-Trial = 52, Category choice = 1, Response = Correct
+Trial = 52, Category choice = 2, Response = False
 Trial = 53, Category choice = 2, Response = Correct
-Trial = 54, Category choice = 1, Response = False
-Trial = 55, Category choice = 2, Response = Correct
+Trial = 54, Category choice = 2, Response = Correct
+Trial = 55, Category choice = 1, Response = False
 Trial = 56, Category choice = 2, Response = Correct
-Trial = 57, Category choice = 2, Response = False
+Trial = 57, Category choice = 1, Response = Correct
 Trial = 58, Category choice = 1, Response = Correct
-Trial = 59, Category choice = 1, Response = Correct
-Trial = 60, Category choice = 1, Response = Correct
-Trial = 61, Category choice = 2, Response = Correct
+Trial = 59, Category choice = 2, Response = False
+Trial = 60, Category choice = 2, Response = False
+Trial = 61, Category choice = 1, Response = False
 Trial = 62, Category choice = 2, Response = Correct
 Trial = 63, Category choice = 1, Response = False
-Trial = 64, Category choice = 1, Response = Correct
-Trial = 65, Category choice = 1, Response = Correct
+Trial = 64, Category choice = 2, Response = False
+Trial = 65, Category choice = 2, Response = False
 Trial = 66, Category choice = 1, Response = False
-Trial = 67, Category choice = 1, Response = Correct
+Trial = 67, Category choice = 2, Response = False
 Trial = 68, Category choice = 2, Response = Correct
 Trial = 69, Category choice = 1, Response = False
-Trial = 70, Category choice = 1, Response = Correct
+Trial = 70, Category choice = 2, Response = False
 Trial = 71, Category choice = 1, Response = Correct
 Trial = 72, Category choice = 1, Response = False
 Trial = 73, Category choice = 1, Response = False
 Trial = 74, Category choice = 1, Response = Correct
-Trial = 75, Category choice = 1, Response = Correct
-Trial = 76, Category choice = 1, Response = False
+Trial = 75, Category choice = 2, Response = False
+Trial = 76, Category choice = 2, Response = Correct
 Trial = 77, Category choice = 2, Response = False
 Trial = 78, Category choice = 1, Response = Correct
-Trial = 79, Category choice = 1, Response = Correct
+Trial = 79, Category choice = 2, Response = False
 Trial = 80, Category choice = 1, Response = Correct
-Trial = 81, Category choice = 1, Response = False
+Trial = 81, Category choice = 2, Response = Correct
 Trial = 82, Category choice = 2, Response = False
-Trial = 83, Category choice = 1, Response = Correct
+Trial = 83, Category choice = 2, Response = False
 Trial = 84, Category choice = 1, Response = False
-Trial = 85, Category choice = 1, Response = False
+Trial = 85, Category choice = 2, Response = Correct
 Trial = 86, Category choice = 1, Response = Correct
 Trial = 87, Category choice = 1, Response = Correct
 Trial = 88, Category choice = 1, Response = Correct
 Trial = 89, Category choice = 1, Response = False
-Trial = 90, Category choice = 1, Response = Correct
+Trial = 90, Category choice = 2, Response = False
 Trial = 91, Category choice = 2, Response = Correct
-Trial = 92, Category choice = 1, Response = Correct
+Trial = 92, Category choice = 2, Response = False
 Trial = 93, Category choice = 2, Response = Correct
 Trial = 94, Category choice = 1, Response = False
 Trial = 95, Category choice = 1, Response = Correct
 Trial = 96, Category choice = 2, Response = Correct
-Trial = 97, Category choice = 1, Response = False
+Trial = 97, Category choice = 2, Response = Correct
 Trial = 98, Category choice = 2, Response = Correct
 Trial = 99, Category choice = 2, Response = False
 Trial = 100, Category choice = 2, Response = False
-(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0], action = [1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2])

trace is a NamedTuple containing useful outcomes for each trial of the experiment:

trace.trial ## trial indices
+(trial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], correct = Bool[0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0], action = [1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2])

trace is a NamedTuple containing useful outcomes for each trial of the experiment:

trace.trial ## trial indices
 trace.correct ## whether the response was correct or not on each trial
 trace.action; ## what responce was made on each trial, 1 is left and 2 is right