potentialfactorymostone.java
来自「是实现关系型贝叶斯网络一中机器学习算法」· Java 代码 · 共 47 行
JAVA
47 行
package rmn;public class PotentialFactoryMostOne extends PotentialFactory { public PotentialFactoryMostOne(double[][] weights) { super(); m_weights = new Matrix2(weights); } public PotentialFactoryMostOne() { super(); m_weights = new Matrix2(2, 2); ((Matrix2) m_weights).m_matrix[0][0] = 1; ((Matrix2) m_weights).m_matrix[0][1] = 1; ((Matrix2) m_weights).m_matrix[1][0] = 1; ((Matrix2) m_weights).m_matrix[1][1] = 0; } public Potential newInstance() { m_nPots++; return new PotentialMostOne(this); } public boolean hasVariableArity() { return true; } public void incTrueCounts(int[] pos) { // not needed for fix-value potentials ? // move this elsewhere } public void incInfCounts(int[] pos) { // not needed for fix-value potentials ? // move this elsewhere }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?