Class BinarizeExpression

java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.indexinglanguage.expressions.Expression
com.yahoo.vespa.indexinglanguage.expressions.BinarizeExpression

public class BinarizeExpression extends Expression
Converts a tensor of any input type into a binarized tensor: Each value is replaced by either 0 or 1.
Author:
bratseth
  • Constructor Details

    • BinarizeExpression

      public BinarizeExpression(double threshold)
      Creates a binarize expression.
      Parameters:
      threshold - the value which the tensor cell value must be larger than to be set to 1 and not 0.
  • Method Details

    • setInputType

      public com.yahoo.document.DataType setInputType(com.yahoo.document.DataType inputType, TypeContext context)
      Description copied from class: Expression
      Sets the input type of this and returns the resulting output type, or null if it cannot be uniquely determined. Subtypes may implement this by calling setInputType(inputType, requiredType, VerificationContext context).
      Overrides:
      setInputType in class Expression
    • setOutputType

      public com.yahoo.document.DataType setOutputType(com.yahoo.document.DataType outputType, TypeContext context)
      Description copied from class: Expression
      Sets the output type of this and returns the resulting input type, or null if it cannot be uniquely determined. Subtypes implement this by calling setOutputType(outputType, requiredType, VerificationContext context).
      Overrides:
      setOutputType in class Expression
    • doExecute

      protected void doExecute(ExecutionContext context)
      Specified by:
      doExecute in class Expression
    • toString

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object