Search in sources :

Example 1 with AutomaticDifferentiation

use of com.sri.ai.expresso.autodifferentiation.AutomaticDifferentiation in project aic-expresso by aic-sri-international.

the class AutomaticDifferentiationTest method makeAutoDifferentiator.

@Before
public void makeAutoDifferentiator() {
    Theory theory = new CommonTheory();
    Context context = new TrueContext(theory);
    autoDifferentiator = new AutomaticDifferentiation(e -> context.evaluate(e));
}
Also used : CommonTheory(com.sri.ai.grinder.application.CommonTheory) TrueContext(com.sri.ai.grinder.core.TrueContext) Context(com.sri.ai.grinder.api.Context) CommonTheory(com.sri.ai.grinder.application.CommonTheory) Theory(com.sri.ai.grinder.api.Theory) AutomaticDifferentiation(com.sri.ai.expresso.autodifferentiation.AutomaticDifferentiation) TrueContext(com.sri.ai.grinder.core.TrueContext) Expressions.parse(com.sri.ai.expresso.helper.Expressions.parse) Expressions(com.sri.ai.expresso.helper.Expressions) Context(com.sri.ai.grinder.api.Context) Test(org.junit.Test) Expression(com.sri.ai.expresso.api.Expression) Assert(org.junit.Assert) Assert.assertEquals(org.junit.Assert.assertEquals) Before(org.junit.Before) AutomaticDifferentiation(com.sri.ai.expresso.autodifferentiation.AutomaticDifferentiation) CommonTheory(com.sri.ai.grinder.application.CommonTheory) Theory(com.sri.ai.grinder.api.Theory) TrueContext(com.sri.ai.grinder.core.TrueContext) Before(org.junit.Before)

Aggregations

Expression (com.sri.ai.expresso.api.Expression)1 AutomaticDifferentiation (com.sri.ai.expresso.autodifferentiation.AutomaticDifferentiation)1 Expressions (com.sri.ai.expresso.helper.Expressions)1 Expressions.parse (com.sri.ai.expresso.helper.Expressions.parse)1 Context (com.sri.ai.grinder.api.Context)1 Theory (com.sri.ai.grinder.api.Theory)1 CommonTheory (com.sri.ai.grinder.application.CommonTheory)1 TrueContext (com.sri.ai.grinder.core.TrueContext)1 Assert (org.junit.Assert)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Before (org.junit.Before)1 Test (org.junit.Test)1