diff --git a/test/nonlinear_least_squares.jl b/test/nonlinear_least_squares.jl index 5b4ff265e..d5c54aa77 100644 --- a/test/nonlinear_least_squares.jl +++ b/test/nonlinear_least_squares.jl @@ -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