Skip to content

Commit 081f3b1

Browse files
committed
fix incorrect gradient and Gauss-Newton Hessian proxy
1 parent d1e0762 commit 081f3b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/trustRegion.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ isinplace(::TrustRegionCache{iip}) where {iip} = iip
304304
function perform_step!(cache::TrustRegionCache{true})
305305
@unpack make_new_J, J, fu, f, u, p, u_tmp, alg, linsolve = cache
306306
if cache.make_new_J
307-
jacobian!!(J, cache)
308-
mul!(cache.H, J, J)
309-
mul!(cache.g, J, fu)
307+
jacobian!(J, cache)
308+
mul!(cache.H, J', J)
309+
mul!(cache.g, J', fu)
310310
cache.stats.njacs += 1
311311
end
312312

@@ -330,9 +330,9 @@ function perform_step!(cache::TrustRegionCache{false})
330330
@unpack make_new_J, fu, f, u, p = cache
331331

332332
if make_new_J
333-
J = jacobian!!(cache.J, cache)
334-
cache.H = J * J
335-
cache.g = J * fu
333+
J = jacobian(cache, f)
334+
cache.H = J' * J
335+
cache.g = J' * fu
336336
cache.stats.njacs += 1
337337
end
338338

0 commit comments

Comments
 (0)