Math typo in residual norm calculation (`2 * √f` instead of `√(2 * f)`)

オープン 初心者向け
#369 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

trunkls.jl から始めて、2 * √f が ϵF を設定およびチェックしているループを見つけ、そこで既に利用可能な rt residual を調べます。residual norm が停止許容値の docstring と一致するようにし、その後、停止動作を検証するためにリポジトリの既存のテストを実行します。

索引モデルが issue の本文から書いたものです。

説明

bug

Description:
In trunkls.jl, the residual norm is calculated using 2 * √f to set and check the stopping tolerance ϵF.

Because the least-squares objective is $f = \frac{1}{2} \Vert{}F(x)\Vert{}^2$, the expression 2 * √f mathematically evaluates to:

$$2 \sqrt{\frac{1}{2} \Vert{}F(x)\Vert{}^2} = \sqrt{2} \Vert{}F(x)\Vert{} \approx 1.414 \Vert{}F(x)\Vert{}$$

This unintentionally scales the residual norm by $\sqrt{2}$, making the stopping condition ~41% stricter than what is explicitly stated in the docstring (‖F(xᵏ)‖ ≤ Fatol + Frtol * ‖F(x⁰)‖).

Proposed Fix:
Change the 2 to be inside the square root: √(2 * f).

Alternatively, since rt (the residual vector) is already evaluated and available in the loop, use norm(rt) directly to avoid the square root operation altogether.

主要言語
Julia
スター
80
フォーク
21
平均マージ
18時間 44分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaSmoothOptimizers/JSOSolvers.jl のほかの issue

JuliaSmoothOptimizers/JSOSolvers.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。