File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,17 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
18
18
StatsFuns = " 4c63d2b9-4356-54db-8cca-17b64c39e42c"
19
19
VecTargets = " 8a639fad-7908-4fe4-8003-906e9297f002"
20
20
21
+ [sources ]
22
+ VecTargets = {url = " https://github.com/chalk-lab/VecTargets.jl" , rev = " main" }
23
+
24
+
21
25
[weakdeps ]
22
26
ADTypes = " 47edcb42-4c32-4615-8424-f2b9edc5f35b"
23
27
ComponentArrays = " b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
24
28
CUDA = " 052768ef-5323-5732-b1bb-66c8b64840ba"
25
29
MCMCChains = " c7f686f2-ff18-58e9-bc7b-31028e88f75d"
26
30
OrdinaryDiffEq = " 1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
27
31
28
- [sources ]
29
- VecTargets = {rev = " main" , url = " https://github.com/chalk-lab/VecTargets.jl" }
30
-
31
32
[extensions ]
32
33
AdvancedHMCADTypesExt = " ADTypes"
33
34
AdvancedHMCComponentArraysExt = " ComponentArrays"
Original file line number Diff line number Diff line change @@ -93,11 +93,11 @@ function ∂H∂θ_cache(
93
93
- (∂ℓπ∂θ - 1 / 2 * diag (term_1_cached * ∂H∂θ) + 1 / 2 * diag (term_2 * ∂H∂θ))
94
94
else
95
95
- mapreduce (vcat, 1 : d) do i
96
- ∂H∂θᵢ = ∂H∂θ[:, :, i]
97
- # ∂ℓπ∂θ[i] - 1 / 2 * tr(term_1_cached * ∂H∂θᵢ) + 1 / 2 * M' * (J .* (Q' * ∂H∂θᵢ * Q)) * M # (v1)
98
- # NOTE Some further optimization can be done here: cache the 1st product all together
99
- ∂ℓπ∂θ[i] - 1 / 2 * tr (term_1_cached * ∂H∂θᵢ) + 1 / 2 * tr (term_2_cached * ∂H∂θᵢ) # (v2) cache friendly
100
- end
96
+ ∂H∂θᵢ = ∂H∂θ[:, :, i]
97
+ # ∂ℓπ∂θ[i] - 1 / 2 * tr(term_1_cached * ∂H∂θᵢ) + 1 / 2 * M' * (J .* (Q' * ∂H∂θᵢ * Q)) * M # (v1)
98
+ # NOTE Some further optimization can be done here: cache the 1st product all together
99
+ ∂ℓπ∂θ[i] - 1 / 2 * tr (term_1_cached * ∂H∂θᵢ) + 1 / 2 * tr (term_2_cached * ∂H∂θᵢ) # (v2) cache friendly
100
+ end
101
101
end
102
102
103
103
dv = DualValue (ℓπ, g)
You can’t perform that action at this time.
0 commit comments