superviseddescent  0.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
Public Member Functions | List of all members
superviseddescent::PartialPivLUSolver Class Reference

#include <regressors.hpp>

Public Member Functions

cv::Mat solve (cv::Mat data, cv::Mat labels, Regulariser regulariser)
 

Detailed Description

A solver that the LinearRegressor uses to solve its system of linear equations. It needs a solve function with the following signature: cv::Mat solve(cv::Mat data, cv::Mat labels, Regulariser regulariser)

The PartialPivLUSolver is a fast solver but it can't check for invertibility. It supports parallel solving if compiled with OpenMP enabled. Uses PartialPivLU::solve() instead of inverting the matrix.

Member Function Documentation

cv::Mat superviseddescent::PartialPivLUSolver::solve ( cv::Mat  data,
cv::Mat  labels,
Regulariser  regulariser 
)
inline

Solves the linear system \( (\text{data}^\text{T} * \text{data} + \text{regulariser}) * \text{X} = \text{data}^\text{T} * \text{labels}\) where regulariser is a diagonal matrix. This results in a least-squares approximation of the original system. labels can consist of multiple columns.

Note/Todo: we should leave the choice of inverting A or AtA to the solver. But this also means we need to pass through the regularisation params. We can't just pass a cv::Mat regularisation because the dimensions for regularising A and AtA are different.

Parameters
[in]dataData matrix with each row being a data sample.
[in]labelsLabels for each data sample.
[in]regulariserA regularisation.
Returns
The solution matrix.

The documentation for this class was generated from the following file: