Search in sources :

Example 6 with IntensionalConvexHullOfFactors

use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors in project aic-praise by aic-sri-international.

the class GradientAnytimeExactBP method getFactorAtRootPolytope.

private IntensionalConvexHullOfFactors getFactorAtRootPolytope() {
    Factor factorAtRoot = Factor.multiply(getBase().getFactorsAtRoot());
    IntensionalConvexHullOfFactors singletonConvexHullOfFactorAtRoot = new IntensionalConvexHullOfFactors(list(), factorAtRoot);
    return singletonConvexHullOfFactorAtRoot;
}
Also used : IntensionalConvexHullOfFactors(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors) ConstantFactor(com.sri.ai.praise.core.representation.interfacebased.factor.core.ConstantFactor) Factor(com.sri.ai.praise.core.representation.interfacebased.factor.api.Factor)

Example 7 with IntensionalConvexHullOfFactors

use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors in project aic-praise by aic-sri-international.

the class GradientAnytimeExactBP method transformApproximationToConvexHullOrThrowsErrorIfNotPossible.

private static IntensionalConvexHullOfFactors transformApproximationToConvexHullOrThrowsErrorIfNotPossible(Approximation<Factor> approximation) {
    AtomicPolytope atomicPolytope = transformApproximationToAtomicPolytopeOrThrowsErrorIfNotPossible(approximation);
    if (!(approximation instanceof IntensionalConvexHullOfFactors)) {
        // can't be simplex because sub is not null
        throw new Error("Unfit type of approximation for gradient descent");
    }
    IntensionalConvexHullOfFactors convexHull = (IntensionalConvexHullOfFactors) atomicPolytope;
    return convexHull;
}
Also used : IntensionalConvexHullOfFactors(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors) AtomicPolytope(com.sri.ai.praise.core.representation.interfacebased.polytope.api.AtomicPolytope)

Example 8 with IntensionalConvexHullOfFactors

use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors in project aic-praise by aic-sri-international.

the class AbstractAEBPTreeNode method addSimplexOrFactortoTheListOfProducts.

public void addSimplexOrFactortoTheListOfProducts(List<Polytope> polytopesToMultiply) {
    if (isRootAFactor()) {
        IntensionalConvexHullOfFactors singletonConvexHullOfFactorAtRoot = new IntensionalConvexHullOfFactors(list(), (Factor) this.getRoot());
        polytopesToMultiply.add(singletonConvexHullOfFactorAtRoot);
    } else if (!isExhausted.apply((Variable) this.getRoot())) {
        polytopesToMultiply.add(new Simplex((Variable) this.getRoot()));
    }
}
Also used : Simplex(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.Simplex) IntensionalConvexHullOfFactors(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors)

Example 9 with IntensionalConvexHullOfFactors

use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors in project aic-praise by aic-sri-international.

the class AnytimeExactBP method getFactorAtRootPolytope.

private IntensionalConvexHullOfFactors getFactorAtRootPolytope() {
    Factor factorAtRoot = Factor.multiply(getBase().getFactorsAtRoot());
    IntensionalConvexHullOfFactors singletonConvexHullOfFactorAtRoot = new IntensionalConvexHullOfFactors(list(), factorAtRoot);
    return singletonConvexHullOfFactorAtRoot;
}
Also used : IntensionalConvexHullOfFactors(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors) Factor(com.sri.ai.praise.core.representation.interfacebased.factor.api.Factor)

Example 10 with IntensionalConvexHullOfFactors

use of com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors in project aic-praise by aic-sri-international.

the class AnytimeExactBP method addFactorAtRootPolytope.

private void addFactorAtRootPolytope(List<Polytope> polytopesToMultiply) {
    IntensionalConvexHullOfFactors singletonConvexHullOfFactorAtRoot = getFactorAtRootPolytope();
    polytopesToMultiply.add(singletonConvexHullOfFactorAtRoot);
}
Also used : IntensionalConvexHullOfFactors(com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors)

Aggregations

IntensionalConvexHullOfFactors (com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.IntensionalConvexHullOfFactors)16 Factor (com.sri.ai.praise.core.representation.interfacebased.factor.api.Factor)9 ConstantFactor (com.sri.ai.praise.core.representation.interfacebased.factor.core.ConstantFactor)7 AtomicPolytope (com.sri.ai.praise.core.representation.interfacebased.polytope.api.AtomicPolytope)5 Variable (com.sri.ai.praise.core.representation.interfacebased.factor.api.Variable)4 Polytope (com.sri.ai.praise.core.representation.interfacebased.polytope.api.Polytope)4 Polytopes.identityPolytope (com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.Polytopes.identityPolytope)3 ArrayList (java.util.ArrayList)3 TableFactor (com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor)2 TableVariable (com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableVariable)2 Simplex (com.sri.ai.praise.core.representation.interfacebased.polytope.core.byexpressiveness.convexhull.Simplex)2 Util.println (com.sri.ai.util.Util.println)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 Predicate (com.google.common.base.Predicate)1 AssignmentsIterator (com.sri.ai.grinder.helper.AssignmentsIterator)1 AEBP (com.sri.ai.praise.core.inference.byinputrepresentation.interfacebased.core.exactbp.anytime.gabriel.AEBP)1 TestCases (com.sri.ai.praise.core.inference.byinputrepresentation.interfacebased.core.exactbp.anytime.gabriel.TestCases)1 AnytimeExactBP (com.sri.ai.praise.core.inference.byinputrepresentation.interfacebased.core.exactbp.anytime.rodrigo.AnytimeExactBP)1 ExactBPNode (com.sri.ai.praise.core.inference.byinputrepresentation.interfacebased.core.exactbp.fulltime.api.ExactBPNode)1