Class Model

java.lang.Object
ai.vespa.models.evaluation.Model
All Implemented Interfaces:
AutoCloseable

public class Model extends Object implements AutoCloseable
A named collection of functions
Author:
bratseth
  • 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

      public String name()
    • functions

      public List<com.yahoo.searchlib.rankingexpression.ExpressionFunction> 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

      public FunctionEvaluator evaluatorOf(String... names)
      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

      public String toString()
      Overrides:
      toString in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable