Scans and reduction functions
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從相關 issue #3339 開始,然後檢視針對 fold_left、fold_right、reduce 和 scan 提出的語意,以及關於平行演算法的連結參考資料。在實作之前,釐清 Stan 應支援哪些函式及其 API 和求值要求;當範圍達成共識且所選函式已一致地實作時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Related to #3339, there are also common higher-order functions that return a different type than their input.
Some common options are:
fold_left(F, T, ...) => f(f(f(f(T[0], T[1]), T[2]), ...), T[3])(sometimes, rather than starting at T[0], an extra 'init' argument is passed)fold_right, which is the same idea but with the opposite associationf(T[0], f(T[1], ...f(T[N], init)))reduce, which is defined such that it is equivalent to the above when thefis associative but does not explicitly state an order of evaluation. The cool thing aboutreduceis it can be parallelized, c.f.foldlandfoldrConsidered Slightly Harmful, and More Fun with Moniodsscan, which returns a cumulative evaluationscan(f, T, ...) => [T[1], f(T[1], T[2]), f(f(T[1], T[2]), T3), ...]. Note thatscancan also be parallelized when f is associative, c.f. Prefix Sums and their Applications. (Note: even thoughreduce(f, T, ...) == scan(f, T, ...)[N], the ideal parallelization algorithms actually differ)
There are other functions of questionable value to Stan in this family, like folding_map which returns both a carry and a mapped container (this is, confusingly, what JAX calls scan. Scans a-la Blelloch as described above are called associative_scan in JAX)
- 主要語言
- C++
- 星號
- 845
- 分支
- 225
- 平均合併
- 4 天 21 小時
- 30 天內合併 PR
- 13
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
stan-dev/math 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 54/100
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 54/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
-
numerics performance
難度 5/5 一週以上 新手友好度 35/100
stan-dev/math#3481 · 1 個 reaction ·
維護者通常 1 天內回覆
-
`eigendecompose_sym`, `eigenvalues_sym` and `eigenvectors_sym` do not compile for complex matrices of `fvar<var>` or `fvar<fvar<double>>`可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug
難度 3/5 1-2 天 新手友好度 55/100
維護者通常 1 天內回覆
相似的 Issue
-
area/ysql kind/bug priority/medium status/awaiting-triage
難度 2/5 1-3 小時 新手友好度 78/100
yugabyte/yugabyte-db#37523 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
Cockatrice/Cockatrice#7896 ·
維護者通常 1 天內回覆
-
mlir
難度 2/5 1-3 小時 新手友好度 72/100
llvm/llvm-project#241070 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 68/100
ros-navigation/navigation2#6771 ·
維護者通常 1 天內回覆
-
backlog documentation
難度 1/5 1 小時以內 新手友好度 96/100
EchoTools/nevr-runtime#2354 ·
維護者通常 1 天內回覆