Files
cs188/bayesian/task.txt
2026-01-01 17:27:18 +08:00

35 lines
974 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

作业二:实现贝叶斯网络近似推理算法
(一)问题描述
实现两种基本的近似推理算法——拒绝采样和似然加权,并在一个简单的
贝叶斯网络PPT 示例)上进行应用和比较。
网络结构图:
C -> S
C -> R
S -> W
R -> W
变量解释:
C(Cloudy): 是否多云 (Boolean)
S(Sprinkler): 洒水器是否开启 (Boolean)
R(Rain): 是否下雨 (Boolean)
W(WetGrass): 草坪是否湿润 (Boolean)
条件概率表 (CPTs):
P(C=T) = 0.5
P(S | C):
P(S=T | C=T) = 0.10
P(S=T | C=F) = 0.50
P(R | C):
P(R=T | C=T) = 0.80
P(R=T | C=F) = 0.20
P(W | S, R):
P(W=T | S=T, R=T) = 0.99
P(W=T | S=T, R=F) = 0.90
P(W=T | S=F, R=T) = 0.90
P(W=T | S=F, R=F) = 0.00
(二) 任务要求
实现拒绝采样算法和似然加权算法,算法需要能够估计条件概率 P(X | e)
其中 X 是查询变量e 是证据。使用你实现的两种算法估计 P(R | S=T,
W=T)。
要求撰写实验报告,提供源程序。