|
void | tpt_svm_linear_init_f32 (tpt_svm_linear_f32_t *aSVM, uint32_t nbOfSupportVectors, uint32_t vectorDimension, f32_t intercept, const f32_t *dualCoefficients, const f32_t *supportVectors, const int32_t *classes) |
| SVM linear instance init function. More...
|
|
void | tpt_svm_linear_predict_f32 (int32_t *aResult, const tpt_svm_linear_f32_t *aSVM, const f32_t *aInData) |
| SVM linear prediction. More...
|
|
void | tpt_svm_polynomial_init_f32 (tpt_svm_polynomial_f32_t *aSVM, uint32_t nbOfSupportVectors, uint32_t vectorDimension, f32_t intercept, const f32_t *dualCoefficients, const f32_t *supportVectors, const int32_t *classes, int32_t degree, f32_t coef0, f32_t gamma) |
| SVM polynomial instance init function. More...
|
|
void | tpt_svm_polynomial_predict_f32 (int32_t *aResult, const tpt_svm_polynomial_f32_t *aSVM, const f32_t *aInData) |
| SVM polynomial prediction. More...
|
|
void | tpt_svm_rbf_init_f32 (tpt_svm_rbf_f32_t *aSVM, uint32_t nbOfSupportVectors, uint32_t vectorDimension, f32_t intercept, const f32_t *dualCoefficients, const f32_t *supportVectors, const int32_t *classes, f32_t gamma) |
| SVM radial basis function instance init function. More...
|
|
static uint32_t | top12 (f32_t x) |
|
static f32_t | _expf_ (f32_t x) |
|
void | tpt_svm_rbf_predict_f32 (int32_t *aResult, const tpt_svm_rbf_f32_t *aSVM, const f32_t *aInData) |
| SVM rbf prediction. More...
|
|
void | tpt_svm_sigmoid_init_f32 (tpt_svm_sigmoid_f32_t *aSVM, uint32_t nbOfSupportVectors, uint32_t vectorDimension, f32_t intercept, const f32_t *dualCoefficients, const f32_t *supportVectors, const int32_t *classes, f32_t coef0, f32_t gamma) |
| SVM sigmoid instance init function. More...
|
|
void | tpt_svm_sigmoid_predict_f32 (int32_t *aResult, const tpt_svm_sigmoid_f32_t *aSVM, const f32_t *aInData) |
| SVM sigmoid prediction. More...
|
|
This set of functions is implementing SVM classification on 2 classes. The training must be done from scikit-learn. The parameters can be easily generated from the scikit-learn object.
If more than 2 classes are needed, the functions in this folder will have to be used, as building blocks, to do multi-class classification.
No multi-class classification is provided in this SVM folder.
#define C __exp2f_data.poly_scaled |
◆ EXP2F_POLY_ORDER
#define EXP2F_POLY_ORDER 3 |
◆ EXP2F_TABLE_BITS
#define EXP2F_TABLE_BITS 5 |
SVM rbf prediction.
- Parameters
-
[out] | aResult | decision value |
[in] | aSVM | Pointer to an instance of the rbf SVM structure. |
[in] | aInData | Pointer to input vector |
- Returns
- none.
◆ InvLn2N
#define InvLn2N __exp2f_data.invln2_scaled |
◆ N [1/2]
◆ N [2/2]
#define T __exp2f_data.tab |
◆ _expf_()
◆ top12()
static uint32_t top12 |
( |
f32_t |
x | ) |
|
|
inlinestatic |
◆ tpt_svm_linear_init_f32()
void tpt_svm_linear_init_f32 |
( |
tpt_svm_linear_f32_t * |
aSVM, |
|
|
uint32_t |
nbOfSupportVectors, |
|
|
uint32_t |
vectorDimension, |
|
|
f32_t |
intercept, |
|
|
const f32_t * |
dualCoefficients, |
|
|
const f32_t * |
supportVectors, |
|
|
const int32_t * |
classes |
|
) |
| |
SVM linear instance init function.
Classes are integer used as output of the function (instead of having -1, 1 as class values).
- Parameters
-
[in] | aSVM | Pointer to an instance of the linear SVM structure. |
[in] | nbOfSupportVectors | Number of support vectors |
[in] | vectorDimension | Dimension of vector space |
[in] | intercept | Intercept |
[in] | dualCoefficients | Array of dual coefficients |
[in] | supportVectors | Array of support vectors |
[in] | classes | Array of 2 classes ID |
- Returns
- none.
◆ tpt_svm_linear_predict_f32()
SVM linear prediction.
- Parameters
-
[out] | aResult | Decision value |
[in] | aSVM | Pointer to an instance of the linear SVM structure. |
[in] | aInData | Pointer to input vector |
- Returns
- none.
◆ tpt_svm_polynomial_init_f32()
void tpt_svm_polynomial_init_f32 |
( |
tpt_svm_polynomial_f32_t * |
aSVM, |
|
|
uint32_t |
nbOfSupportVectors, |
|
|
uint32_t |
vectorDimension, |
|
|
f32_t |
intercept, |
|
|
const f32_t * |
dualCoefficients, |
|
|
const f32_t * |
supportVectors, |
|
|
const int32_t * |
classes, |
|
|
int32_t |
degree, |
|
|
f32_t |
coef0, |
|
|
f32_t |
gamma |
|
) |
| |
SVM polynomial instance init function.
Classes are integer used as output of the function (instead of having -1, 1 as class values).
- Parameters
-
[in] | aSVM | points to an instance of the polynomial SVM structure. |
[in] | nbOfSupportVectors | Number of support vectors |
[in] | vectorDimension | Dimension of vector space |
[in] | intercept | Intercept |
[in] | dualCoefficients | Array of dual coefficients |
[in] | supportVectors | Array of support vectors |
[in] | classes | Array of 2 classes ID |
[in] | degree | Polynomial degree |
[in] | coef0 | coeff0 (scikit-learn terminology) |
[in] | gamma | gamma (scikit-learn terminology) |
- Returns
- none.
◆ tpt_svm_polynomial_predict_f32()
SVM polynomial prediction.
- Parameters
-
[out] | aResult | Decision value |
[in] | aSVM | Pointer to an instance of the polynomial SVM structure. |
[in] | aInData | Pointer to input vector |
- Returns
- none.
◆ tpt_svm_rbf_init_f32()
void tpt_svm_rbf_init_f32 |
( |
tpt_svm_rbf_f32_t * |
aSVM, |
|
|
uint32_t |
nbOfSupportVectors, |
|
|
uint32_t |
vectorDimension, |
|
|
f32_t |
intercept, |
|
|
const f32_t * |
dualCoefficients, |
|
|
const f32_t * |
supportVectors, |
|
|
const int32_t * |
classes, |
|
|
f32_t |
gamma |
|
) |
| |
SVM radial basis function instance init function.
Classes are integer used as output of the function (instead of having -1, 1 as class values).
- Parameters
-
[in] | aSVM | points to an instance of the rbf SVM structure. |
[in] | nbOfSupportVectors | Number of support vectors |
[in] | vectorDimension | Dimension of vector space |
[in] | intercept | Intercept |
[in] | dualCoefficients | Array of dual coefficients |
[in] | supportVectors | Array of support vectors |
[in] | classes | Array of 2 classes ID |
[in] | gamma | gamma (scikit-learn terminology) |
- Returns
- none.
◆ tpt_svm_rbf_predict_f32()
SVM rbf prediction.
- Parameters
-
[out] | aResult | decision value |
[in] | aSVM | Pointer to an instance of the rbf SVM structure. |
[in] | aInData | Pointer to input vector |
- Returns
- none.
◆ tpt_svm_sigmoid_init_f32()
void tpt_svm_sigmoid_init_f32 |
( |
tpt_svm_sigmoid_f32_t * |
aSVM, |
|
|
uint32_t |
nbOfSupportVectors, |
|
|
uint32_t |
vectorDimension, |
|
|
f32_t |
intercept, |
|
|
const f32_t * |
dualCoefficients, |
|
|
const f32_t * |
supportVectors, |
|
|
const int32_t * |
classes, |
|
|
f32_t |
coef0, |
|
|
f32_t |
gamma |
|
) |
| |
SVM sigmoid instance init function.
Classes are integer used as output of the function (instead of having -1, 1 as class values).
- Parameters
-
[in] | aSVM | points to an instance of the sigmoid SVM structure. |
[in] | nbOfSupportVectors | Number of support vectors |
[in] | vectorDimension | Dimension of vector space |
[in] | intercept | Intercept |
[in] | dualCoefficients | Array of dual coefficients |
[in] | supportVectors | Array of support vectors |
[in] | classes | Array of 2 classes ID |
[in] | coef0 | coeff0 (scikit-learn terminology) |
[in] | gamma | gamma (scikit-learn terminology) |
- Returns
- none.
◆ tpt_svm_sigmoid_predict_f32()
SVM sigmoid prediction.
- Parameters
-
[out] | aResult | Decision value |
[in] | aSVM | Pointer to an instance of the sigmoid SVM structure. |
[in] | aInData | Pointer to input vector |
- Returns
- none.