Implements a Singular Value Decomposition (SVD) function for machine learning.
More...
#include <SVD.h>
|
| | SVD (float *bu, float *bi, float *pu, float *qi, int numUser, int numItem, int latentDims) |
| | Constructor for SVD.
|
| |
| void | apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &outputType, exec::EvalCtx &context, VectorPtr &output) const override |
| | Applies the SVD function to the input data.
|
| |
| float * | getTensor () const override |
| | Returns the tensor associated with the function.
|
| |
| std::string | getFuncName () |
| | Returns the name of the function.
|
| |
| std::string | getWeightsFile () |
| | Returns the path to the weights file.
|
| |
| void | setWeights (float *weights) |
| | Sets the weights for the function.
|
| |
| CostEstimate | getCost (std::vector< int > inputDims) |
| | Estimates the cost of the function.
|
| |
|
virtual | ~MLFunction ()=default |
| | Virtual destructor.
|
| |
| virtual std::vector< int > | getDims () |
| | Returns the dimensions of the function.
|
| |
| virtual int | getNumDims () |
| | Returns the number of dimensions of the function.
|
| |
|
| static std::vector< std::shared_ptr< exec::FunctionSignature > > | signatures () |
| | Returns the function signatures.
|
| |
| static std::string | getName () |
| | Returns the name of the function.
|
| |
|
| double | getWeightedCost (std::string name, float cost) |
| | Calculates the weighted cost of the function.
|
| |
| std::vector< double > | getCoefficientVector (std::string name) |
| | Retrieves the cost coefficients for the function.
|
| |
|
std::vector< int > | dims |
| | Dimensions of the function.
|
| |
Implements a Singular Value Decomposition (SVD) function for machine learning.
◆ SVD()
| SVD::SVD |
( |
float * | bu, |
|
|
float * | bi, |
|
|
float * | pu, |
|
|
float * | qi, |
|
|
int | numUser, |
|
|
int | numItem, |
|
|
int | latentDims ) |
|
inline |
Constructor for SVD.
- Parameters
-
| bu | Array of user biases. |
| bi | Array of item biases. |
| pu | Array of user latent factors. |
| qi | Array of item latent factors. |
| numUser | Number of users. |
| numItem | Number of items. |
| latentDims | Number of latent dimensions. |
◆ apply()
| void SVD::apply |
( |
const SelectivityVector & | rows, |
|
|
std::vector< VectorPtr > & | args, |
|
|
const TypePtr & | outputType, |
|
|
exec::EvalCtx & | context, |
|
|
VectorPtr & | output ) const |
|
inlineoverride |
Applies the SVD function to the input data.
- Parameters
-
| rows | Selectivity vector indicating which rows to process. |
| args | Vector of input arguments. |
| outputType | Type of the output vector. |
| context | Evaluation context. |
| output | Output vector to store the results. |
◆ getCost()
| CostEstimate SVD::getCost |
( |
std::vector< int > | inputDims | ) |
|
|
inlinevirtual |
Estimates the cost of the function.
- Parameters
-
| inputDims | Dimensions of the input. |
- Returns
- Cost estimate.
Reimplemented from MLFunction.
◆ getFuncName()
| std::string SVD::getFuncName |
( |
| ) |
|
|
inlinevirtual |
Returns the name of the function.
- Returns
- Function name.
Reimplemented from MLFunction.
◆ getName()
| static std::string SVD::getName |
( |
| ) |
|
|
inlinestatic |
Returns the name of the function.
- Returns
- Function name.
◆ getTensor()
| float * SVD::getTensor |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the tensor associated with the function.
- Returns
- Pointer to the tensor.
Implements MLFunction.
◆ getWeightsFile()
| std::string SVD::getWeightsFile |
( |
| ) |
|
|
inline |
Returns the path to the weights file.
- Returns
- Path to the weights file.
◆ setWeights()
| void SVD::setWeights |
( |
float * | weights | ) |
|
|
inline |
Sets the weights for the function.
- Parameters
-
| weights | Pointer to the weights array. |
◆ signatures()
| static std::vector< std::shared_ptr< exec::FunctionSignature > > SVD::signatures |
( |
| ) |
|
|
inlinestatic |
Returns the function signatures.
- Returns
- Vector of function signatures.
The documentation for this class was generated from the following file: