Skip to content

Commit

Permalink
Fix residual
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Nov 6, 2023
1 parent 87203f4 commit f2d3285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/nonlinear_least_squares.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ y_target = true_function(x, θ_true)

function loss_function(θ, p)
= true_function(p, θ)
return abs2.(.- y_target)
return.- y_target
end

function loss_function(resid, θ, p)
true_function(resid, p, θ)
resid .= abs2.(resid .- y_target)
resid .= resid .- y_target
return resid
end

Expand Down

0 comments on commit f2d3285

Please sign in to comment.