56 virtual CostEstimate
getCost(std::vector<int> inputDims) {
57 return CostEstimate(0, inputDims[0], inputDims[1]);
71 std::vector<double> coefficient =
72 UdfCostCoefficient::getInstance().getCoefficient(name);
84 return UdfCostCoefficient::getInstance().getCoefficient(name);
A base class for machine learning functions, inheriting from Velox's VectorFunction.
Definition BaseFunction.h:9
virtual float * getTensor() const =0
Returns the tensor associated with this function.
virtual std::vector< int > getDims()
Returns the dimensions of the function.
Definition BaseFunction.h:28
virtual CostEstimate getCost(std::vector< int > inputDims)
Estimates the computational cost of applying the function.
Definition BaseFunction.h:56
virtual std::string getFuncName()
Returns the name of the function.
Definition BaseFunction.h:37
double getWeightedCost(std::string name, float cost)
Calculates the weighted cost of the function.
Definition BaseFunction.h:70
virtual ~MLFunction()=default
Virtual destructor.
virtual int getNumDims()
Returns the number of dimensions of the function.
Definition BaseFunction.h:46
std::vector< double > getCoefficientVector(std::string name)
Retrieves the cost coefficients for the function.
Definition BaseFunction.h:83
std::vector< int > dims
Dimensions of the function.
Definition BaseFunction.h:61