Wrong results for forward-mode `exp!` half of the time
@sethaxen ci sta già lavorando.
Dal 17/5/2023.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
If I repeatedly run the example below, I get the wrong result for the gradient through exp! about half of the time.
using LinearAlgebra, ForwardDiff, FiniteDiff, ForwardDiffChainRules
@ForwardDiff_frule LinearAlgebra.exp!(x1::AbstractMatrix{<:ForwardDiff.Dual})
function test_exp(x)
X = copy(reshape(x, 4, 4))
X2 = LinearAlgebra.exp!(X)
sum(X2)
end
for i = 1:20
x = randn(16)
X = reshape(x, 4, 4)
g1 = ForwardDiff.gradient(test_exp, x)
g2 = FiniteDiff.finite_difference_gradient(test_exp, x)
@show norm(g1-g2)
end
norm(g1 - g2) = 3.2745988814567806
norm(g1 - g2) = 2.7005934051461515e-9
norm(g1 - g2) = 3.535502368190921
norm(g1 - g2) = 5.376574873194121e-10
norm(g1 - g2) = 2.4158271822718778e-9
norm(g1 - g2) = 3.0885755390647527e-10
norm(g1 - g2) = 4.215282668056846
norm(g1 - g2) = 1.7888448238515218
norm(g1 - g2) = 2.1068558951714456e-10
norm(g1 - g2) = 8.090031857043094
norm(g1 - g2) = 5.8514613833452644
norm(g1 - g2) = 5.859275463330073e-10
norm(g1 - g2) = 3.3486620002856527e-10
norm(g1 - g2) = 1.1628716126438234
norm(g1 - g2) = 2.72443511328846
norm(g1 - g2) = 1.5771975088961793e-10
norm(g1 - g2) = 1.2073055237629486e-9
norm(g1 - g2) = 8.255800634241801
norm(g1 - g2) = 2.2459662479919337e-10
norm(g1 - g2) = 4.433466845638335
Also reported in https://github.com/ThummeTo/ForwardDiffChainRules.jl/issues/14
- Lingua principale
- Julia
- Stelle
- 475
- Fork
- 98
- Merge medio
- 1g 3h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaDiff/ChainRules.jl
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
JuliaDiff/ChainRules.jl#818 ·
-
refactoring
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
JuliaDiff/ChainRules.jl#815 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
JuliaDiff/ChainRules.jl#810 ·
-
stack overflow issueAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
JuliaDiff/ChainRules.jl#809 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
JuliaDiff/ChainRules.jl#803 · 4 commenti ·
Tutte le issue di JuliaDiff/ChainRules.jl
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaGPU/KernelAbstractions.jl#897 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oscar-system/GAP.jl#1455 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
JuliaAI/MLJTransforms.jl#85 ·