Flow adaptation fits much worse when the posterior scale is small
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Start by running the included 50-dimensional normal example and compare fisher_distance and final step size at the two covariance scales. The payload does not name implementation files or tests, and says the cause is unknown, so trace how adaptation="flow" and with_transform_adapt handle scale changes. Done means the flow fits comparably at small and unit scales while sampling still recovers the target statistics.
由索引模型根据 Issue 内容生成。
描述
adaptation="flow" fits the flow much worse when the posterior's scale is small, even with x64 enabled. On a correlated 50-dimensional normal, the mean fisher distance is 0.025 at unit scale and 2090 after scaling the covariance by 1e-8, and the final step size drops from 1.62 to 0.066. Sampling still recovers the means and standard deviations to within about 15%, and the cause isn't established.
import jax
jax.config.update("jax_enable_x64", True)
import numpy as np
import pymc as pm
import nutpie
rng = np.random.default_rng(0)
dim = 50
factor = rng.normal(size=(dim, dim)) / np.sqrt(dim)
correlation = factor @ factor.T + 0.1 * np.eye(dim)
for scale in [1.0, 1e-4]:
with pm.Model() as model:
pm.MvNormal("x", mu=np.zeros(dim), cov=correlation * scale**2)
compiled = nutpie.compile_pymc_model(model, backend="jax", gradient_backend="jax")
trace = nutpie.sample(compiled.with_transform_adapt(num_layers=4), adaptation="flow",
chains=1, draws=500, seed=1, progress_bar=False)
print(f"scale={scale:.0e} fisher_distance={float(trace.sample_stats['fisher_distance'].mean()):.3f}")
# scale=1e+00 fisher_distance=0.025
# scale=1e-04 fisher_distance=2090.241
- 主要语言
- Python
- 星标
- 214
- 派生
- 30
- 平均合并
- 3 小时 50 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pymc-devs/nutpie 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 1/5 1 小时以内 新手友好度 72/100
-
with_data fails with a list on the jax backend可能已有人在做 @RaphaelFakhri 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
-
normalizing-flows
难度 3/5 1-2 天 新手友好度 58/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
pathintegral-institute/mcpm.sh#568 ·
维护者通常 21 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
invarislabs/invaris-agentsec#98 ·
维护者通常 1 天内回复
-
5-minutes beginner-friendly documentation good first issue hacktoberfest help wanted no-code-needed python
难度 1/5 1 小时以内 新手友好度 65/100
Huerte/algo-solutions-python#364 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
Becksteinlab/imdclient#161 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复