Package ai.vespa.models.evaluation
Class Model
java.lang.Object
ai.vespa.models.evaluation.Model
- All Implemented Interfaces:
AutoCloseable
A named collection of functions
- Author:
- bratseth
-
Constructor Summary
ConstructorsConstructorDescriptionModel(String name, Collection<com.yahoo.searchlib.rankingexpression.ExpressionFunction> functions) Programmatically create a model containing functions without constant of function references only -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()evaluatorOf(String... names) Returns an evaluator which can be used to evaluate the given function in a single thread once.List<com.yahoo.searchlib.rankingexpression.ExpressionFunction>Returns an immutable list of the free, public functions of this.name()toString()
-
Constructor Details
-
Model
public Model(String name, Collection<com.yahoo.searchlib.rankingexpression.ExpressionFunction> functions) Programmatically create a model containing functions without constant of function references only
-
-
Method Details
-
name
-
functions
Returns an immutable list of the free, public functions of this. The functions returned always specifies types of all arguments and the return value -
evaluatorOf
Returns an evaluator which can be used to evaluate the given function in a single thread once. Usage:Tensor result = model.evaluatorOf("myFunction").bind("foo", value).bind("bar", value).evaluate()- Parameters:
names- the names identifying the function - this can be from 0 to 2, specifying function or "signature" name, and "output", respectively. Names which are unnecessary to determine the desired function uniquely (e.g if there is just one function or output) can be omitted. A two-component name can alternatively be specified as a single argument with components separated by dot.- Throws:
IllegalArgumentException- if the function is not present, or not uniquely identified by the names given
-
toString
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-