计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
graph-models【效率与协作】Guides pomegranate BayesianNetwork and FactorGraph workflows, including categorical graph construction, structure learning, factor-graph inference, masked missing-value prediction, and graph troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill for directed categorical Bayesian networks, direct factor-graph inference, categorical structure learning, and discrete missing-value inference with torch.masked.MaskedTensor. It covers BayesianNetwork, FactorGraph, Categorical, ConditionalCategorical, and JointCategorical interactions.
Typical imports:
from pomegranate.distributions import Categorical, ConditionalCategorical, JointCategorical
from pomegranate.bayesian_network import BayesianNetwork
from pomegranate.factor_graph import FactorGraph
Read references/api-reference.md for constructors, edge semantics, structure learning, and inference examples. Run scripts/smoke_graph_models.py for a self-contained Monty Hall Bayesian-network check and a tiny factor-graph check.
structure or algorithm='chow-liu'/'exact' and call fit.Categorical; child nodes with parents use ConditionalCategorical; factor-graph factors use Categorical or JointCategorical.predict, predict_proba, and predict_log_proba infer missing variables from torch.masked.MaskedTensor where mask=True means observed.State, Node, or bake; v1.x uses direct distribution objects.BayesianNetwork currently expects Categorical and ConditionalCategorical node distributions.FactorGraph is bipartite: edges connect marginals to factors, not factor-to-factor or marginal-to-marginal.predict_proba returns a list of tensors, one per variable, because variables can have different category counts.