本文整理汇总了C++中BayesNet::SetPSoftMax方法的典型用法代码示例。如果您正苦于以下问题:C++ BayesNet::SetPSoftMax方法的具体用法?C++ BayesNet::SetPSoftMax怎么用?C++ BayesNet::SetPSoftMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BayesNet
的用法示例。
在下文中一共展示了BayesNet::SetPSoftMax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BayesNet
BayesNet *SimpleCondSoftMaxModel()
{
BayesNet *net;
net = new BayesNet();
net->AddNode("continuous^node0");
net->AddNode("continuous^node1");
net->AddNode("continuous^node2");
net->AddNode("discrete^node3", "True False");
net->AddNode("discrete^node5", "True False");// condsoftmax node
net->AddNode("discrete^node6", "True False");
net->AddArc("node0", "node5");
net->AddArc("node1", "node5");
net->AddArc("node2", "node5");
net->AddArc("node3", "node5");
net->AddArc("node5", "node6");
net->SetPGaussian("node0", "0.1", "0.9");
net->SetPGaussian("node1", "0.2", "0.8");
net->SetPGaussian("node2", "0.3", "0.7");
net->SetPTabular("node6^True node6^False", "0.3 0.7", "node5^True");
net->SetPTabular("node6^True node6^False", "0.5 0.5", "node5^False");
net->SetPSoftMax("node5^True node5^False", "0.3 0.4 0.5 0.6 0.7 0.8", "0.1 0.1", "node3^True");
net->SetPSoftMax("node5^True node5^False", "0.23 0.24 0.25 0.26 0.27 0.28", "0.21 0.21", "node3^False");
return net;
}
示例2: CropModel
BayesNet* CropModel()
{
// Subsidy(d) Crop(c)
// | |
// V V
// Price(c)
// |
// V
// Buy(d)
BayesNet *net;
net = new BayesNet();
textcolor(WHITE);
net->AddNode(discrete^"Subsidy", "Yes No");
printf("\n net->AddNode(discrete^\"Subsidy\", \"Yes No\");");
textcolor(LIGHTGREEN);
printf("\t\t\t\t\t\tAdding of nodes is in process....");
_sleep(2000);
textcolor(WHITE);
net->AddNode(continuous ^ "Crop");
printf("\n net->AddNode(continuous ^ \"Crop\");");
_sleep(1000);
net->AddNode(continuous ^ "Price");
printf("\n net->AddNode(continuous ^ \"Price\");");
_sleep(1000);
net->AddNode(discrete^"Buy", "Yes No");
printf("\n net->AddNode(discrete^\"Buy\", \"Yes No\");");
textcolor(LIGHTGREEN);
printf("\n ......All nodes are added....\n");
getch();
// arcs
textcolor(WHITE);
net->AddArc("Subsidy Crop", "Price");
printf("\n net->AddArc(\"Subsidy Crop\", \"Price\");");
textcolor(LIGHTGREEN);
printf("\t\t\t\t\t\t\tAdding of arcs is in process....");
_sleep(2000);
textcolor(WHITE);
net->AddArc("Price", "Buy");
printf("\n net->AddArc(\"Price\", \"Buy\");");
textcolor(LIGHTGREEN);
printf("\n ......All arcs are added....\n");
getch();
// distributions
textcolor(WHITE);
net->SetPTabular("Subsidy^Yes Subsidy^No", "0.3 0.7");
printf("\n net->SetPTabular(\"Subsidy^Yes Subsidy^No\", \"0.3 0.7\");");
textcolor(LIGHTGREEN);
printf("\t\t\t\t\tAdding of distributions is in process....");
_sleep(2000);
textcolor(WHITE);
net->SetPGaussian("Crop", "5.0", "1.0");
printf("\n net->SetPGaussian(\"Crop\", \"5.0\", \"1.0\");");
_sleep(1000);
net->SetPGaussian("Price", "10.0", "1.0", "-1.0", "Subsidy^Yes");
printf("\n net->SetPGaussian(\"Price\", \"10.0\", \"1.0\", \"-1.0\", \"Subsidy^Yes\");");
_sleep(1000);
net->SetPGaussian("Price", "20.0", "1.0", "-1.0", "Subsidy^No");
printf("\n net->SetPGaussian(\"Price\", \"20.0\", \"1.0\", \"-1.0\", \"Subsidy^No\");");
_sleep(1000);
net->SetPSoftMax("Buy^Yes Buy^No", "-1.0 1.0", "5.0 -5.0");
printf("\n net->SetPSoftMax(\"Buy^Yes Buy^No\", \"-1.0 1.0\", \"5.0 -5.0\");");
textcolor(LIGHTGREEN);
printf("\n ......All distributions are added....\n");
getch();
textcolor(WHITE);
return net;
}