continue_run applies adaptive_files/MLE_params.txt by position, with no check of its length or of which parameter each value belongs to

オープン
#1,044 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

Read pybnf/algorithms/samplers/base.py around lines 371–374 and pybnf/algorithms/samplers/adaptive_mcmc.py around lines 283 and 630 to trace how MLE values are saved and loaded. Check the existing tests for continue_run and how configuration parameter names are represented. Done when loading rejects a count or name mismatch with a clear error, and a one-parameter file loads without an indexing error.

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

説明

bug silent-incorrectness

adaptive_files/MLE_params.txt holds values only, with no parameter names (written by np.savetxt at pybnf/algorithms/samplers/adaptive_mcmc.py:630). continue_run = 1 applies those values by position (pybnf/algorithms/samplers/base.py:371-374; adaptive_mcmc.py:283). Nothing checks the file against the configuration:

  • Too many values: an extra value is silently dropped.
  • Reordered declarations: if the uniform_var lines are reordered between runs, or the file is permuted, every chain starts from the wrong values, possibly outside the boxes, with no error.
  • One free parameter: np.loadtxt returns a 0-d array, so self.mle_start[i] should raise "too many indices". The 0-d return is confirmed; the full continue_run run is not.

#1013 covers the same problems for starting_params; this is the continue_run side. It was found in independent review of the #984 follow-ups.

Fix: write the names, and on load check the count and the names against the configuration. Refuse a mismatch, naming it.

主要言語
Python
スター
25
フォーク
25
平均マージ
4時間 5分
マージ済み PR(30日)
10

環境構築

はじめの一歩

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

lanl/PyBNF のほかの issue

lanl/PyBNF の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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