Model methods fail on a reloaded fit when the data was passed in memory
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start with the $save_object() and $init_model_methods() methods on the fit object, and with $save_data_file(), which the issue says is the only way the data survives. Reproduce by saving a fit whose data was passed as a list, reloading it in a new session, and calling $log_prob(). Done means the model methods compile on the reloaded fit when data is supplied to $init_model_methods(), and the existing save/reload tests still pass.
索引モデルが issue の本文から書いたものです。
説明
A fit created with data = list(...), saved with $save_object() and reloaded in a new R session compiles the model methods and then errors:
# session 1
fit <- cmdstanr_example("logistic")
fit$save_object("fit.rds")
# session 2
fit <- readRDS("fit.rds")
fit$log_prob(rep(0, 4))
#> Error : Error in JSON parsing
#> at offset 0:
#> The document is empty.
The fitted model object only stores the path to the JSON file CmdStanR wrote in the first session's tempdir, and $save_object() reads in the draws and diagnostics but not the data (on purpose since data files can be very large). This means that in the new session the path points nowhere unless the user had previously called fit$save_data_file() before the end of the initial session.
Instead of storing the data in the fit (we want to avoid this), we can add a data argument to $init_model_methods() for the cases when it's needed.
- 主要言語
- R
- スター
- 165
- フォーク
- 69
- 平均マージ
- 23時間 26分
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stan-dev/cmdstanr のほかの issue
-
internal-code
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
stan-dev/cmdstanr#506 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
internal-code
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
stan-dev/cmdstanr#1314 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
stan-dev/cmdstanr#1175 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
CmdStanR 1.0 releaseオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
stan-dev/cmdstanr#1059 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
stan-dev/cmdstanr の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
REditorSupport/languageserver#833 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
Rdatatable/data.table#7952 ·
メンテナーはふだん 1 日以内に返信
-
priority: could techdebt
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/ML-For-Beginners#1061 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Rapporteket/rapbase#535 ·