`IndependentConfig` synthesis raises "Cliques must be unique."
维护者通常 2 天内回复
还没有人认领这个 Issue。
- #4 来自 @gghatano —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
调研方向
从 dpsynth/discrete_mechanisms/independent.py 第 73 行开始,使用 IndependentConfig 运行提供的 pandas 复现代码。确认 INDEPENDENT 路径不再引发 duplicate-clique ValueError,同时 MST 和 AIM 仍能正常工作,并且估计输入保持不变。
由索引模型根据 Issue 内容生成。
描述
Summary
Calling dpsynth.generate(...) with discrete_config=IndependentConfig() fails
with a ValueError from mbi.CliqueVector.expand. MST and AIM work on the same
input; only INDEPENDENT is affected.
Environment
- Linux, Python 3.12, current
mbi(git+https://github.com/ryan112358/mbi.git)
Reproduction
import pandas as pd
import dpsynth
from dpsynth import domain, discrete_mechanisms as dm
df = pd.DataFrame({
"a": ["x", "y", "x", "y"] * 50,
"b": [0, 1, 1, 0] * 50,
})
domains = {
"a": domain.CategoricalAttribute(possible_values=["x", "y"]),
"b": domain.CategoricalAttribute(possible_values=[0, 1]),
}
dpsynth.generate(df, domains, epsilon=1.0, delta=1e-5,
discrete_config=dm.IndependentConfig())
ValueError: Cliques must be unique.
File ".../dpsynth/discrete_mechanisms/independent.py", line 73, in run_mechanism
potentials = potentials.expand([m.clique for m in measurements])
File ".../mbi/clique_vector.py", line 55, in __attrs_post_init__
raise ValueError("Cliques must be unique.")
Cause
In independent.run_mechanism, measurements starts from
initial_measurements — the one-way marginals that
data_generation_v2.generate always passes in — and then the loop appends a
freshly measured one-way marginal for every attribute. So measurements
contains each one-way clique twice.
When initial_potentials is not None (e.g. the empty CliqueVector returned by
constraints.get_initial_parameters even when there are no cross-attribute
constraints), line 73 calls
potentials.expand([m.clique for m in measurements]) with that duplicated
clique list. Current mbi requires unique cliques in expand, so it raises.
Suggested fix
De-duplicate the clique list (order-preserving) before calling expand. The
measurements passed to mirror_descent are left unchanged, so estimation and
privacy accounting are unaffected. PR attached.
- 主要语言
- Python
- 星标
- 32
- 派生
- 13
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/dpsynth 的其他 Issue
-
import dpsynth fails because mbi.Dataset is registered as a JAX dataclass twice可能已有人在做 @hanzalaareeb 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
Clarify installation requirements in quickstart.ipynb可能已有人在做 @hanzalaareeb 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
Windows install of pylock.toml fails on the pipeline extra due to missing Windows wheel for python-dp可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 2 天内回复
-
Add an option to control the maximum marginal degree in AIM workload construction可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 2 天内回复
-
Lazy-load TensorFlow for TFRecord-specific pipeline paths可能已有人在做 @hanzalaareeb 于 50 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
enhancement good first issue Stellar Wave trivial
难度 2/5 1-3 小时 新手友好度 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
IBM/ai-atlas-nexus#295 ·
维护者通常 6 天内回复
-
github_actions
难度 2/5 1-3 小时 新手友好度 65/100
Hochfrequenz/aibap.mcp#578 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
mishraprafful/multihull#150 ·
维护者通常 1 天内回复