public Factor duplicate () { return new BoltzmannPairFactor (x1, x2, sigma); }
public boolean almostEquals (Factor p, double epsilon) { return equals (p); }
public BoltzmannPairFactor (Variable x1, Variable x2, double sigma) { super (new HashVarSet (new Variable[] { x1, x2 }), sigma2vals(sigma)); this.sigma = sigma; this.x1 = x1; this.x2 = x2; if (x1.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x1+" in BoltzmannUnary must be binary."); } if (x2.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x2+" in BoltzmannUnary must be binary."); } }
public BoltzmannPairFactor (Variable x1, Variable x2, double sigma) { super (new HashVarSet (new Variable[] { x1, x2 }), sigma2vals(sigma)); this.sigma = sigma; this.x1 = x1; this.x2 = x2; if (x1.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x1+" in BoltzmannUnary must be binary."); } if (x2.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x2+" in BoltzmannUnary must be binary."); } }
public Factor duplicate () { return new BoltzmannPairFactor (x1, x2, sigma); }
public boolean almostEquals (Factor p, double epsilon) { return equals (p); }
public BoltzmannPairFactor (Variable x1, Variable x2, double sigma) { super (new HashVarSet (new Variable[] { x1, x2 }), sigma2vals(sigma)); this.sigma = sigma; this.x1 = x1; this.x2 = x2; if (x1.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x1+" in BoltzmannUnary must be binary."); } if (x2.getNumOutcomes () != 2) { throw new IllegalArgumentException ("Discrete variable "+x2+" in BoltzmannUnary must be binary."); } }
public Factor duplicate () { return new BoltzmannPairFactor (x1, x2, sigma); }
public boolean almostEquals (Factor p, double epsilon) { return equals (p); }
private static Factor generateMixedPotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = r.nextGaussian () * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }
private static Factor generateMixedPotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = r.nextGaussian () * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }
private static Factor generateMixedPotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = r.nextGaussian () * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }
private static Factor generateAttractivePotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = -Math.abs (r.nextGaussian ()) * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }
private static Factor generateAttractivePotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = -Math.abs (r.nextGaussian ()) * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }
private static Factor generateAttractivePotential (Random r, double edgeWeight, Variable v1, Variable v2) { double b = -Math.abs (r.nextGaussian ()) * edgeWeight; return new BoltzmannPairFactor(v1, v2, 2*b); }